Mercurial > vim
diff src/search.c @ 22647:0dd527d9c62d v8.2.1872
patch 8.2.1872: matchfuzzy() does not prefer sequential matches
Commit: https://github.com/vim/vim/commit/e9f9f16387554e5b34ba42ce00c42c28dd66af58
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Oct 20 19:01:30 2020 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 20 Oct 2020 19:15:04 +0200 |
parents | 381bd66762ea |
children | f8bf2c122452 |
line wrap: on
line diff
--- 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