Skip to content

Commit

Permalink
Fix Lua regex to allow require"foo" & require("foo") (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
bew authored Dec 21, 2024
1 parent 6ccc0ad commit 6fd6944
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/import/regex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local regex = {
go = [[^\t(\".*\")|^import (\".*\")]],
java = [[^import\s+((static\s+)?[\w.]+\*?);\s*$]],
javascript = [[^(?:import(?:[\"'\s]*([\w*{}\n, ]+)from\s*)?[\"'\s](.*?)[\"'\s].*)]],
lua = [[^local (\w+) = require\([\"'](.*?)[\"']\)]],
lua = [[^local (\w+) = require\(?[\"'](.*?)[\"']\)?]],
php = [[^\s*use\s+([\w\\]+)(?:\s*;)?]],
python = [[(?m)^(?:from[ ]+(\S+)[ ]+)?import[ ]+(\S+)[ ]*$]],
shell = [[^(?:source\s+)]],
Expand Down

0 comments on commit 6fd6944

Please sign in to comment.