Treat _ and - alike for case-insensitive fuzzy matching

Closes #3584.
This commit is contained in:
Mahmoud Al-Qudsi
2018-10-28 06:23:29 -05:00
parent e09e1e8e41
commit 1015e74480
3 changed files with 52 additions and 6 deletions

View File

@@ -1859,7 +1859,7 @@ string_fuzzy_match_t string_fuzzy_match_string(const wcstring &string,
result.match_distance_first = match_against.size() - string.size();
result.match_distance_second = location; // prefer earlier matches
} else if (limit_type >= fuzzy_match_substring_case_insensitive &&
(location = ifind(match_against, string)) != wcstring::npos) {
(location = ifind(match_against, string, true)) != wcstring::npos) {
// A case-insensitive version of the string is in the match against.
result.type = fuzzy_match_substring_case_insensitive;
assert(match_against.size() >= string.size());