aboutsummaryrefslogtreecommitdiff
path: root/lua/plugins/number-inc-dec.lua
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-07-12 19:05:03 +0200
committerMarc André Tanner <mat@brain-dump.org>2017-07-14 11:45:15 +0200
commit386eac2063bdda79279bbdea2fffcd7fc0ff682a (patch)
tree73ef16bc7f07ba8848020b98be3cde123f5b0a36 /lua/plugins/number-inc-dec.lua
parent546917d21ca10214c24d3871c92b81265de6958c (diff)
downloadvis-386eac2063bdda79279bbdea2fffcd7fc0ff682a.tar.gz
vis-386eac2063bdda79279bbdea2fffcd7fc0ff682a.tar.xz
vis-lua: make selection first class primitives in Lua API
Diffstat (limited to 'lua/plugins/number-inc-dec.lua')
-rw-r--r--lua/plugins/number-inc-dec.lua6
1 files changed, 3 insertions, 3 deletions
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