From 5e10cd364b132506a21fc0aca4ce5f0a920f5bc5 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Thu, 14 Oct 2021 16:30:55 +0200 Subject: [PATCH] Assistant: Save match all match points in Fuzzy Match From what I think, the array should consist of point indexes that have been matched instead of just the last one. For example, these are the array contents after searching 'file' for 'File Manager': - Before: [ 3 ] - Now: [ 0, 1, 2, 3 ] Besides that, this greatly improves the scoring logic, as it can now calculate bonuses. Closes: #8310 --- Userland/Applications/Assistant/FuzzyMatch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Applications/Assistant/FuzzyMatch.cpp b/Userland/Applications/Assistant/FuzzyMatch.cpp index 3453fb0634..c1e3fd2ec9 100644 --- a/Userland/Applications/Assistant/FuzzyMatch.cpp +++ b/Userland/Applications/Assistant/FuzzyMatch.cpp @@ -97,8 +97,8 @@ static FuzzyMatchResult fuzzy_match_recursive(String const& needle, String const best_recursive_score = result.score; } had_recursive_match = true; - matches[next_match++] = haystack_idx; } + matches[next_match++] = haystack_idx; needle_idx++; } haystack_idx++;