diff options
| author | Maxime Coste <mawww@kakoune.org> | 2023-11-16 12:59:55 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2023-11-16 12:59:55 +1100 |
| commit | b10a935b8ceb18f256bd04843a5442d7c746abdb (patch) | |
| tree | 413fc79221e1838e2a2fe679f5eb39af287a10c6 /src/ranked_match.cc | |
| parent | a42aa1e47e7f7d1a1b407ef6bb9c434fdab23f81 (diff) | |
Drop last character for basename matching
If the candidate ends with a slash we still look at the previous
component as the basename.
Diffstat (limited to 'src/ranked_match.cc')
| -rw-r--r-- | src/ranked_match.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ranked_match.cc b/src/ranked_match.cc index 6b3305ac..a0eedda4 100644 --- a/src/ranked_match.cc +++ b/src/ranked_match.cc @@ -136,7 +136,7 @@ RankedMatch::RankedMatch(StringView candidate, StringView query, TestFunc func) if (res->single_word) m_flags |= Flags::SingleWord; - if (auto it = find(candidate | reverse(), '/').base(); + if (auto it = find(candidate | reverse() | skip(1), '/').base(); it == candidate.begin() or subsequence_match_smart_case({it, candidate.end()}, query)) { m_flags |= Flags::BaseName; |
