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)
diff --git a/src/search.c b/src/search.c
index 349eae0..8133df4 100644
--- a/src/search.c
+++ b/src/search.c
@@ -4252,8 +4252,9 @@
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