Problem: Sorting of fuzzy filename completion is not stable
Solution: Compare indexes when scores are equal. Fix some typos.
(zeertzjq)
closes: #15593
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
int idx_b = *(const int *)b;
int score_a = compl_fuzzy_scores[idx_a];
int score_b = compl_fuzzy_scores[idx_b];
- return (score_a > score_b) ? -1 : (score_a < score_b) ? 1 : 0;
+ return score_a == score_b ? (idx_a == idx_b ? 0 : (idx_a < idx_b ? -1 : 1))
+ : (score_a > score_b ? -1 : 1);
}
/*
{
pos_T current_pos = *pos;
pos_T circly_end;
- int found_new_match = FAIL;
+ int found_new_match = FALSE;
int looped_around = FALSE;
if (whole_line)
-|/+0&#ffffff0|n|o|n|_|e|x|i|t|_|f|o|l|d|e|r> @58
+|/+0&#ffffff0|n|o|n|_|e|x|i|s|t|i|n|g|_|f|o|l|d|e|r> @54
|~+0#4040ff13&| @73
|~| @73
|~| @73
call VerifyScreenDump(buf, 'Test_pum_highlights_11', {})
" issue #15357
- call term_sendkeys(buf, "\<ESC>S/non_exit_folder\<C-X>\<C-F>")
+ call term_sendkeys(buf, "\<ESC>S/non_existing_folder\<C-X>\<C-F>")
call TermWait(buf, 50)
call VerifyScreenDump(buf, 'Test_pum_highlights_15', {})
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 705,
/**/
704,
/**/