patch 9.1.0963: fuzzy-matching does not prefer full match

Problem:  fuzzy-matching does not prefer full match
          (Maxim Kim)
Solution: add additional score for a full match
          (glepnir)

fixes: #15654
closes: #16300

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
glepnir
2024-12-26 15:38:39 +01:00
committed by Christian Brabandt
parent f07ae5b3bd
commit 5a04999a74
4 changed files with 16 additions and 3 deletions

View File

@ -1,4 +1,4 @@
*pattern.txt* For Vim version 9.1. Last change: 2024 Nov 09
*pattern.txt* For Vim version 9.1. Last change: 2024 Dec 26
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1504,6 +1504,7 @@ criteria:
- Matches at a camel case character (e.g. Case in CamelCase)
- Matches after a path separator or a hyphen.
- The number of unmatched characters in a string.
- A full/exact match is preferred.
The matching string with the highest score is returned first.
For example, when you search for the "get pat" string using fuzzy matching, it