From 162edf7b30dd4a98b85fa490d0dfd1a73db23b88 Mon Sep 17 00:00:00 2001 From: glepnir Date: Tue, 18 Mar 2025 15:44:45 +0800 Subject: vim-patch:9.1.1214: matchfuzzy() can be improved for camel case matches Problem: When searching for "Cur", CamelCase matches like "lCursor" score higher than exact prefix matches like Cursor, which is counter-intuitive (Maxim Kim). Solution: Add a 'camelcase' option to matchfuzzy() that lets users disable CamelCase bonuses when needed, making prefix matches rank higher. (glepnir) fixes: vim/vim#16504 closes: vim/vim#16797 https://github.com/vim/vim/commit/28e40a7b55ce471656cccc2260c11a29d5da447e Co-authored-by: glepnir --- src/nvim/quickfix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/quickfix.c') diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 44b66c4f73..5f197bc84f 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -5356,7 +5356,7 @@ static bool vgr_match_buflines(qf_list_T *qfl, char *fname, buf_T *buf, char *sp // Fuzzy string match CLEAR_FIELD(matches); - while (fuzzy_match(str + col, spat, false, &score, matches, (int)sz) > 0) { + while (fuzzy_match(str + col, spat, false, &score, matches, (int)sz, true) > 0) { // Pass the buffer number so that it gets used even for a // dummy buffer, unless duplicate_name is set, then the // buffer will be wiped out below. -- cgit