From 386eac2063bdda79279bbdea2fffcd7fc0ff682a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 12 Jul 2017 19:05:03 +0200 Subject: vis-lua: make selection first class primitives in Lua API --- lua/plugins/number-inc-dec.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lua/plugins/number-inc-dec.lua') diff --git a/lua/plugins/number-inc-dec.lua b/lua/plugins/number-inc-dec.lua index e1142ef..26a8825 100644 --- a/lua/plugins/number-inc-dec.lua +++ b/lua/plugins/number-inc-dec.lua @@ -15,8 +15,8 @@ local change = function(delta) if not count then count = 1 end vis.count = nil -- reset count, otherwise it affects next motion - for cursor in win:cursors_iterator() do - local pos = cursor.pos + for selection in win:selections_iterator() do + local pos = selection.pos if not pos then goto continue end local word = file:text_object_word(pos); if not word then goto continue end @@ -50,7 +50,7 @@ local change = function(delta) end file:delete(s, e - s) file:insert(s, number) - cursor.pos = s + selection.pos = s ::continue:: end end -- cgit v1.2.3