diff --git a/src/insexpand.c b/src/insexpand.c index f3cbeb2531..8ec549ae02 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -5710,11 +5710,14 @@ ins_compl_get_exp(pos_T *ini) } may_trigger_modechanged(); - if (is_nearest_active() && !ins_compl_has_preinsert()) - sort_compl_match_list(cp_compare_nearest); + if (match_count > 0) + { + if (is_nearest_active() && !ins_compl_has_preinsert()) + sort_compl_match_list(cp_compare_nearest); - if ((get_cot_flags() & COT_FUZZY) && ins_compl_leader_len() > 0) - ins_compl_fuzzy_sort(); + if ((get_cot_flags() & COT_FUZZY) && ins_compl_leader_len() > 0) + ins_compl_fuzzy_sort(); + } return match_count; } diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 84d1236e3c..77be5b42e7 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -3705,6 +3705,22 @@ func Test_complete_fuzzy_collect() set completeopt& cfc& cpt& endfunc +" Issue #18752 +func Test_complete_fuzzy_collect_multiwin() + new + set completefuzzycollect=keyword,files,whole_line + set completeopt=fuzzy + + vnew + call setline(1, ["completeness,", "compatibility", "Composite", "Omnipotent"]) + wincmd p + call feedkeys("Somp\\0", 'tx!') + call assert_equal('Omnipotent', getline('.')) + + bw! + set completeopt& cfc& +endfunc + func Test_cfc_with_longest() new set completefuzzycollect=keyword,files,whole_line diff --git a/src/version.c b/src/version.c index 1a6093ac92..ebb3f3974d 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1918, /**/ 1917, /**/