vim-patch:9.1.1800: completion: strange behaviour with 'ac' completeopt=longest,preinsert

Problem:  completion: strange behaviour with 'ac'
          completeopt=longest,preinsert (zeertzjq)
Solution: Let preinsert take precedence (Girish Palya)

fixes: vim/vim#18410
closes: vim/vim#18428

d35e5e4237

Co-authored-by: Girish Palya <girishji@gmail.com>
This commit is contained in:
zeertzjq
2025-09-30 09:06:09 +08:00
parent e6b2255ac7
commit f30a33858f
3 changed files with 16 additions and 5 deletions

View File

@@ -2736,7 +2736,8 @@ bool ins_compl_prep(int c)
// Set "compl_get_longest" when finding the first matches.
if (ctrl_x_mode_not_defined_yet()
|| (ctrl_x_mode_normal() && !compl_started)) {
compl_get_longest = (get_cot_flags() & kOptCotFlagLongest) != 0;
compl_get_longest = (get_cot_flags() & kOptCotFlagLongest) != 0
&& !ins_compl_has_autocomplete();
compl_used_match = true;
}