From: zeertzjq Date: Sun, 21 Jun 2026 12:52:36 +0000 (+0000) Subject: patch 9.2.0682: Wrong dot-repeat when calling complete() while filtering completion X-Git-Tag: v9.2.0682^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37a7e4944f9ef61cfc9c3dd30f76ab130948c2ef;p=thirdparty%2Fvim.git patch 9.2.0682: Wrong dot-repeat when calling complete() while filtering completion Problem: Wrong dot-repeat when calling complete() while filtering Ctrl-N completion. Solution: Also check compl_started for whether completion is active. (zeertzjq) related: neovim/neovim#40346 closes: #20595 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- diff --git a/src/insexpand.c b/src/insexpand.c index 019fd252ac..5adad45309 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -3878,7 +3878,7 @@ set_completion(colnr_T startcol, list_T *list) int compl_no_select = (cur_cot_flags & COT_NOSELECT) != 0; // If already doing completions stop it. - if (ctrl_x_mode_not_default()) + if (compl_started || ctrl_x_mode_not_default()) ins_compl_prep(' '); ins_compl_clear(); ins_compl_free(); diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index aafc4a84d3..93ca66f5a9 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -6401,4 +6401,20 @@ func Test_smartcase_longest() delfunc TestInner endfunc +" Check that calling complete() while filtering Ctrl-N completion doesn't +" break dot-repeat. +func Test_call_complete_while_filtering() + new + setlocal complete=. completeopt=menuone,noselect + inoremap call complete(3, ['obar', 'obaz']) + call setline(1, ['foobar', 'foobaz']) + + call feedkeys("Gofo\ob\cd\", 'tx') + call assert_equal(['foobar', 'foobaz', 'foobcd'], getline(1, '$')) + normal! . + call assert_equal(['foobar', 'foobaz', 'foobcd', 'foobcd'], getline(1, '$')) + + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab nofoldenable diff --git a/src/version.c b/src/version.c index edf47e86b7..4275dec4b8 100644 --- a/src/version.c +++ b/src/version.c @@ -759,6 +759,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 682, /**/ 681, /**/