diff options
-rw-r--r-- | init.lua | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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.") |