diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-10-20 19:01:30 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-10-20 19:01:30 +0200 |
commit | e9f9f16387554e5b34ba42ce00c42c28dd66af58 (patch) | |
tree | ae00de3d74be30a34cd5b4e7a704481789719a3d /src/search.c | |
parent | c95940c06a125d3afe6516f11f8b2f5697a6b3b9 (diff) | |
download | vim-git-e9f9f16387554e5b34ba42ce00c42c28dd66af58.tar.gz |
patch 8.2.1872: matchfuzzy() does not prefer sequential matchesv8.2.1872
Problem: Matchfuzzy() does not prefer sequential matches.
Solution: Give sequential matches a higher bonus. (Christian Brabandt,
closes #7140)
Diffstat (limited to 'src/search.c')
-rw-r--r-- | src/search.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/search.c b/src/search.c index 349eae035..8133df4b0 100644 --- a/src/search.c +++ b/src/search.c @@ -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 |