0
0
mirror of https://github.com/vim/vim.git synced 2025-11-16 23:24:03 -05:00

patch 9.1.0487: completed item not update on fuzzy completion

Problem:  completed item not update on fuzzy completion
Solution: reset compl_shown_match when at original match position
          (glepnir)

closes: #14955

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
glepnir
2024-06-14 21:11:56 +02:00
committed by Christian Brabandt
parent 82a579e15a
commit f94c9c482a
3 changed files with 15 additions and 0 deletions

View File

@@ -1222,6 +1222,7 @@ ins_compl_build_pum(void)
{
compl_T *compl;
compl_T *shown_compl = NULL;
compl_T *after_first_compl = NULL;
int did_find_shown_match = FALSE;
int shown_match_ok = FALSE;
int i;
@@ -1298,6 +1299,8 @@ ins_compl_build_pum(void)
}
else if (compl_fuzzy_match)
{
if (i == 0)
after_first_compl = compl;
// Update the maximum fuzzy score and the shown match
// if the current item's score is higher
if (compl->cp_score > max_fuzzy_score)
@@ -1318,6 +1321,8 @@ ins_compl_build_pum(void)
{
shown_match_ok = TRUE;
cur = 0;
if (match_at_original_text(compl_shown_match))
compl_shown_match = after_first_compl;
}
}