diff --git a/lua/plugins/complete-word.lua b/lua/plugins/complete-word.lua index 781275144..5e355e87e 100644 --- a/lua/plugins/complete-word.lua +++ b/lua/plugins/complete-word.lua @@ -33,4 +33,6 @@ vis:map(vis.modes.INSERT, "", function() out = out:sub(#prefix + 1, #out - 1) file:insert(pos, out) win.selection.pos = pos + #out + -- restore mode to what it was on entry + vis.mode = vis.modes.INSERT end, "Complete word in file")