patch 9.0.2039: completion shows current word after completion restart
Problem: completion shows current word after completion restart
Solution: remove the word being completed after completion restart
The word being completed is shown in a completion list after completion
restart, because it isn't removed from the current buffer before
searching for matches.
Also adjust `Test_complete_add_onechar` to match the new behavior.
closes: #13349
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: nwounkn <nwounkn@gmail.com>
diff --git a/src/insexpand.c b/src/insexpand.c
index f225cd3..ad4edc1 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -4157,7 +4157,7 @@
ins_compl_update_shown_match();
if (allow_get_expansion && insert_match
- && (!(compl_get_longest || compl_restarting) || compl_used_match))
+ && (!compl_get_longest || compl_used_match))
// Delete old text to be replaced
ins_compl_delete();