aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--init.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 5c0e803..70fe144 100644
--- a/init.lua
+++ b/init.lua
@@ -3,13 +3,14 @@
local lpeg = vis.lpeg
local l = vis.lexers
-local dq_str = l.range('"', true)
-local sq_str = l.range("'", true)
local delimiters = lpeg.S('"\'\t\v\f\r()[]{} \n=')
local offset_pattern = lpeg.C(lpeg.P(":") * lpeg.P("/")^0 * lpeg.R("09")^1 + (1 - delimiters)^1)
-local filename = dq_str + sq_str + (1 - delimiters)^1
vis:map(vis.modes.NORMAL, "gf", function(keys)
+ local dq_str = l.range('"', true)
+ local sq_str = l.range("'", true)
+ local filename = dq_str + sq_str + (1 - delimiters)^1
+
local mstart, mend = vis.win.file:match_at(filename, vis.win.selection.pos, 200)
if not mstart or not mend then
vis:info("No filename found under the cursor.")