mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
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: #14910 Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
ce6fe84db2
commit
dca57fb542
@ -1313,6 +1313,8 @@ ins_compl_build_pum(void)
|
|||||||
}
|
}
|
||||||
else if (compl_fuzzy_match)
|
else if (compl_fuzzy_match)
|
||||||
{
|
{
|
||||||
|
// Update the maximum fuzzy score and the shown match
|
||||||
|
// if the current item's score is higher
|
||||||
if (compl->cp_score > max_fuzzy_score)
|
if (compl->cp_score > max_fuzzy_score)
|
||||||
{
|
{
|
||||||
did_find_shown_match = TRUE;
|
did_find_shown_match = TRUE;
|
||||||
@ -1321,6 +1323,10 @@ ins_compl_build_pum(void)
|
|||||||
shown_match_ok = TRUE;
|
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
|
if (!compl_no_select
|
||||||
&& (max_fuzzy_score > 0
|
&& (max_fuzzy_score > 0
|
||||||
|| (compl_leader == NULL || lead_len == 0)))
|
|| (compl_leader == NULL || lead_len == 0)))
|
||||||
@ -4075,6 +4081,9 @@ ins_compl_show_filename(void)
|
|||||||
redraw_cmdline = FALSE; // don't overwrite!
|
redraw_cmdline = FALSE; // don't overwrite!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* find a completion item in when completeopt include fuzzy option
|
||||||
|
*/
|
||||||
static compl_T *
|
static compl_T *
|
||||||
find_comp_when_fuzzy(void)
|
find_comp_when_fuzzy(void)
|
||||||
{
|
{
|
||||||
@ -4094,7 +4103,7 @@ find_comp_when_fuzzy(void)
|
|||||||
target_idx = compl_selected_item + 1;
|
target_idx = compl_selected_item + 1;
|
||||||
else if (is_backward)
|
else if (is_backward)
|
||||||
target_idx = compl_selected_item == -1 ? compl_match_arraysize - 1
|
target_idx = compl_selected_item == -1 ? compl_match_arraysize - 1
|
||||||
: compl_selected_item - 1;
|
: compl_selected_item - 1;
|
||||||
|
|
||||||
score = compl_match_array[target_idx].pum_score;
|
score = compl_match_array[target_idx].pum_score;
|
||||||
str = compl_match_array[target_idx].pum_text;
|
str = compl_match_array[target_idx].pum_text;
|
||||||
|
@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
466,
|
||||||
/**/
|
/**/
|
||||||
465,
|
465,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user