diff options
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -16,8 +16,8 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) return end - local _, _, path, line = string.find(ref, "^(.+):(%d+)$") - if path == nil or line == nil or line == 1 or not file_exists(path) then + local path, line, column = ref:match("^(.-):(%d+):?(%d*):?$") + if not path or not line or tonumber(line) == 1 or not file_exists(path) then return end @@ -28,8 +28,14 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- After the other handlers ran we set the position. vis:feedkeys(line.."G") + if column then + vis:feedkeys(tostring(column) .. "l") + end + -- Stop handling the old FILE_OPEN event since we changed the file and emitted -- a new WIN_OPEN event + + -- Prevent further WIN_OPEN event handlers from running return true end) |
