aboutsummaryrefslogtreecommitdiff
path: root/lua/plugins/complete-word.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/complete-word.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/complete-word.lua')
-rw-r--r--lua/plugins/complete-word.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/lua/plugins/complete-word.lua b/lua/plugins/complete-word.lua
index 68ce385..41d112c 100644
--- a/lua/plugins/complete-word.lua
+++ b/lua/plugins/complete-word.lua
@@ -1,9 +1,9 @@
--- complete word at primary cursor location using vis-complete(1)
+-- complete word at primary selection location using vis-complete(1)
vis:map(vis.modes.INSERT, "<C-n>", function()
local win = vis.win
local file = win.file
- local pos = win.cursor.pos
+ local pos = win.selection.pos
if not pos then return end
local range = file:text_object_word(pos > 0 and pos-1 or pos);
if not range then return end
@@ -18,5 +18,5 @@ vis:map(vis.modes.INSERT, "<C-n>", function()
return
end
file:insert(pos, out)
- win.cursor.pos = pos + #out
+ win.selection.pos = pos + #out
end, "Complete word in file")