diff options
author | Canop <cano.petrole@gmail.com> | 2021-12-31 18:19:56 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2021-12-31 18:20:49 +0100 |
commit | 22dfebe356134e736e8534dd35661f5a5ad18edc (patch) | |
tree | 1217360eccdbcbfb5c7ccd14ceb49003c2eb31eb /src/pattern | |
parent | 22908e0dfef18e8accf9a2125f8349b448aea2e6 (diff) |
total_search shows all matches
This is experimental and might be reversed in a future version
Diffstat (limited to 'src/pattern')
-rw-r--r-- | src/pattern/fuzzy_pattern.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pattern/fuzzy_pattern.rs b/src/pattern/fuzzy_pattern.rs index 2bc28f1..457b5bc 100644 --- a/src/pattern/fuzzy_pattern.rs +++ b/src/pattern/fuzzy_pattern.rs @@ -181,8 +181,8 @@ impl FuzzyPattern { } let mut best_score = 0; let mut best_match: Option<NameMatch> = None; - let n = cand_chars.len() - self.chars.len(); - for start_idx in 0..=n { + let n = cand_chars.len() + 1 - self.chars.len(); + for start_idx in 0..n { if cand_chars[start_idx] == self.chars[0] { match self.tight_match_from_index(&cand_chars, start_idx) { MatchSearchResult::Perfect(m) => { |