1
0
forked from aniani/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 #7140)
This commit is contained in:
Bram Moolenaar
2020-10-20 19:01:30 +02:00
parent c95940c06a
commit e9f9f16387
3 changed files with 23 additions and 7 deletions

View File

@@ -4252,8 +4252,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