From 915442440ae8227f7e6fe6fa795cba3be36928e8 Mon Sep 17 00:00:00 2001 From: Randy Palamar Date: Mon, 25 Mar 2024 18:43:15 -0600 Subject: [PATCH] complete-word: restore mode to INSERT on exit --- lua/plugins/complete-word.lua | 2 ++ 1 file changed, 2 insertions(+) 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")