1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-04 06:18:35 +03:00
kakoune/src/ranked_match.hh

31 lines
729 B
C++
Raw Normal View History

#ifndef ranked_match_hh_INCLUDED
#define ranked_match_hh_INCLUDED
#include "string.hh"
namespace Kakoune
{
struct RankedMatch
{
2015-10-28 00:25:18 +03:00
RankedMatch(StringView candidate, StringView query);
const StringView& candidate() const { return m_candidate; }
bool operator<(const RankedMatch& other) const;
bool operator==(const RankedMatch& other) const { return m_candidate == other.m_candidate; }
explicit operator bool() const { return not m_candidate.empty(); }
private:
StringView m_candidate;
bool m_first_char_match = false;
bool m_prefix = false;
int m_word_boundary_match_count = 0;
2016-03-25 01:04:56 +03:00
int m_match_index_sum = 0;
bool m_only_word_boundary = false;
};
}
#endif // ranked_match_hh_INCLUDED