aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2020-09-02 19:02:39 +0200
committerMatěj Cepl <mcepl@cepl.eu>2020-09-02 19:02:39 +0200
commit36fe0faa59948e3363aa6b88ac62a217328fa3f3 (patch)
treeacaaa91192915e37a3447633cae4ea75d5a5eb77
parent215db15f519ea6bade7491ef70f90b7b584edc94 (diff)
downloadvis-jump-36fe0faa59948e3363aa6b88ac62a217328fa3f3.tar.gz
Restore position of cursor
-rw-r--r--init.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 2ed6525..79d1b27 100644
--- a/init.lua
+++ b/init.lua
@@ -61,8 +61,11 @@ end, "Jump to URL")
-- https://en.opensuse.org/openSUSE:Packaging_Patches_guidelines#Current_set_of_abbreviations
vis:map(vis.modes.NORMAL, "gG", function()
+ local my_col = vis.win.selection.col
+ local my_line = vis.win.selection.line
M.replace_URLs()
vis.win:draw()
+ vis.win.selection:to(my_line, my_col)
end, "Shorten URLs")
vis:operator_new("gK", function(file, range, pos)
-- local cmd = getPath(debug.getinfo(2,'S').source) .. "abbrevURL.lua"