vim-patch:9.1.0490: minor style problems with patch 9.1.0487 (#29354)

Problem:  minor style problems with patch 9.1.0487
Solution: use shown_compl instead of after_first_compl variable
          (glepnir)

closes: vim/vim#15008

fix(completion): use exist shown_compl instead after_first_compl

105f741fac

Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
zeertzjq 2024-06-15 22:06:29 +08:00 committed by GitHub
parent fd2ef4edf9
commit fc6477002c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1162,7 +1162,6 @@ static int ins_compl_build_pum(void)
// Need to build the popup menu list. // Need to build the popup menu list.
compl_match_arraysize = 0; compl_match_arraysize = 0;
compl_T *comp = compl_first_match; compl_T *comp = compl_first_match;
compl_T *after_first_compl = NULL;
// If it's user complete function and refresh_always, // If it's user complete function and refresh_always,
// do not use "compl_leader" as prefix filter. // do not use "compl_leader" as prefix filter.
@ -1232,7 +1231,7 @@ static int ins_compl_build_pum(void)
cur = i; cur = i;
} else if (compl_fuzzy_match) { } else if (compl_fuzzy_match) {
if (i == 0) { if (i == 0) {
after_first_compl = comp; shown_compl = comp;
} }
// Update the maximum fuzzy score and the shown match // Update the maximum fuzzy score and the shown match
// if the current item's score is higher // if the current item's score is higher
@ -1253,7 +1252,7 @@ static int ins_compl_build_pum(void)
shown_match_ok = true; shown_match_ok = true;
cur = 0; cur = 0;
if (match_at_original_text(compl_shown_match)) { if (match_at_original_text(compl_shown_match)) {
compl_shown_match = after_first_compl; compl_shown_match = shown_compl;
} }
} }
} }