aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 553b41f..2bb477c 100644
--- a/init.lua
+++ b/init.lua
@@ -10,6 +10,12 @@ end
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
if win.file == nil or win.file.path == nil then return end
local ref = win.file.path
+
+ -- if the file with colon actually exists, don't do anything
+ if file_exists(ref) then
+ return
+ end
+
local _, _, path, line = string.find(ref, "^(.+):(%d+)$")
if path == nil or line == nil or line == 0 or not file_exists(path) then
return
@@ -19,5 +25,4 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win)
vis:command("e "..path)
vis:command("+"..line-1)
-- or vis:feedkeys(tostring(line).."G")
- return
end)