From c9963e2212bda7a4d2186469ad07078d348353cf Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 17 Oct 2023 17:49:22 +0800 Subject: 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 https://github.com/vim/vim/commit/2e3cd52fa02b1a208c97992b1bca3b04f7be66d4 Co-authored-by: nwounkn --- src/nvim/insexpand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 6f99708e1d..09860a6a40 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -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(); } -- cgit