diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-07-19 20:18:47 +0200 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-07-19 20:18:47 +0200 |
| commit | ec1824d3c3e734a5718fa96e4b37fbd808bfc5c6 (patch) | |
| tree | 7d558efe3a1ea46ff9c388bff71a7b82fc904308 | |
| parent | 016a50f21368265a70665d8442b0c6585329b71a (diff) | |
Make non smart case full match better than smart case full match
| -rw-r--r-- | src/ranked_match.cc | 6 | ||||
| -rw-r--r-- | src/ranked_match.hh | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/ranked_match.cc b/src/ranked_match.cc index 0a3ad5a1..2bfb8d8b 100644 --- a/src/ranked_match.cc +++ b/src/ranked_match.cc @@ -144,7 +144,11 @@ RankedMatch::RankedMatch(StringView candidate, StringView query, TestFunc func) { m_flags |= Flags::Prefix; if (query.length() == candidate.length()) - m_flags |= Flags::FullMatch; + { + m_flags |= Flags::SmartFullMatch; + if (candidate == query) + m_flags |= Flags::FullMatch; + } } } diff --git a/src/ranked_match.hh b/src/ranked_match.hh index 9d0e3b73..379b855d 100644 --- a/src/ranked_match.hh +++ b/src/ranked_match.hh @@ -42,7 +42,8 @@ private: Contiguous = 1 << 2, OnlyWordBoundary = 1 << 3, Prefix = 1 << 4, - FullMatch = 1 << 5, + SmartFullMatch = 1 << 5, + FullMatch = 1 << 6, }; friend constexpr bool with_bit_ops(Meta::Type<Flags>) { return true; } |
