vim-patch:9.0.2039: completion shows current word after completion restart (#25682)

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: vim/vim#13349

2e3cd52fa0

Co-authored-by: nwounkn <nwounkn@gmail.com>
This commit is contained in:
zeertzjq
2023-10-17 17:49:22 +08:00
committed by GitHub
parent 35f475d0a5
commit c9963e2212
2 changed files with 13 additions and 2 deletions

View File

@@ -3635,7 +3635,7 @@ static int ins_compl_next(bool allow_get_expansion, int count, bool insert_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();
}