aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua10
1 files changed, 4 insertions, 6 deletions
diff --git a/init.lua b/init.lua
index 6268d59..9799bb2 100644
--- a/init.lua
+++ b/init.lua
@@ -25,12 +25,10 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win)
-- fire a new WIN_OPEN event because we changed the file
vis.events.emit(vis.events.WIN_OPEN, win)
- -- After the other handlers ran we set the position.
- vis:feedkeys(line.."G")
-
- if column then
- vis:feedkeys(tostring(column) .. "l")
- end
+ -- After the other handlers ran we set the position
+ column = column or 1
+ local pos = win.file:pos_by_linecol(line, column)
+ vis.win.selection.pos = pos
-- Stop handling the old FILE_OPEN event since we changed the file and emitted
-- a new WIN_OPEN event