vim-patch:8.2.1872: matchfuzzy() does not prefer sequential matches

Problem:    Matchfuzzy() does not prefer sequential matches.
Solution:   Give sequential matches a higher bonus. (Christian Brabandt,
            closes vim/vim#7140)
e9f9f16387
This commit is contained in:
Sean Dewar
2022-01-01 21:12:53 +00:00
parent 960ea01972
commit 8313d31e4a
2 changed files with 21 additions and 7 deletions

View File

@@ -4818,8 +4818,9 @@ typedef struct {
list_T *lmatchpos;
} fuzzyItem_T;
/// bonus for adjacent matches
#define SEQUENTIAL_BONUS 15
/// bonus for adjacent matches; this is higher than SEPARATOR_BONUS so that
/// matching a whole word is preferred.
#define SEQUENTIAL_BONUS 40
/// bonus if match occurs after a separator
#define SEPARATOR_BONUS 30
/// bonus if match is uppercase and prev is lower