vim-patch:9.1.0466: Missing comments for fuzzy completion

Problem:  Missing comments for fuzzy completion (after 9.1.0463)
Solution: Add more comments, adjust indentation slightly
          (glepnir)

closes: vim/vim#14910

dca57fb542

Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
zeertzjq 2024-06-05 15:02:20 +08:00
parent c2e836c41c
commit 818cb27e48

View File

@ -1249,6 +1249,8 @@ static int ins_compl_build_pum(void)
}
cur = i;
} else if (compl_fuzzy_match) {
// Update the maximum fuzzy score and the shown match
// if the current item's score is higher
if (comp->cp_score > max_fuzzy_score) {
did_find_shown_match = true;
max_fuzzy_score = comp->cp_score;
@ -1256,6 +1258,10 @@ static int ins_compl_build_pum(void)
shown_match_ok = true;
}
// If there is no "no select" condition and the max fuzzy
// score is positive, or there is no completion leader or the
// leader length is zero, mark the shown match as valid and
// reset the current index.
if (!compl_no_select
&& (max_fuzzy_score > 0
|| (compl_leader == NULL || lead_len == 0))) {
@ -3633,6 +3639,7 @@ static void ins_compl_show_filename(void)
redraw_cmdline = false; // don't overwrite!
}
/// find a completion item in when completeopt include fuzzy option
static compl_T *find_comp_when_fuzzy(void)
{
int target_idx = -1;