Code cleanups
This commit is contained in:
parent
3a699c8ac3
commit
7ecd65e1af
|
@ -61,7 +61,7 @@ static CandidateList complete_buffer_name(StringView query, ByteCount cursor_pos
|
|||
{
|
||||
struct RankedMatchAndBuffer : RankedMatch
|
||||
{
|
||||
RankedMatchAndBuffer(const RankedMatch& m, const Buffer* b = nullptr)
|
||||
RankedMatchAndBuffer(const RankedMatch& m, const Buffer* b)
|
||||
: RankedMatch{m}, buffer{b} {}
|
||||
|
||||
using RankedMatch::operator==;
|
||||
|
|
|
@ -97,7 +97,7 @@ InsertCompletion complete_word(const Buffer& buffer, ByteCoord cursor_pos, const
|
|||
|
||||
struct RankedMatchAndBuffer : RankedMatch
|
||||
{
|
||||
RankedMatchAndBuffer(const RankedMatch& m, const Buffer* b = nullptr)
|
||||
RankedMatchAndBuffer(const RankedMatch& m, const Buffer* b)
|
||||
: RankedMatch{m}, buffer{b} {}
|
||||
|
||||
using RankedMatch::operator==;
|
||||
|
@ -130,18 +130,10 @@ InsertCompletion complete_word(const Buffer& buffer, ByteCoord cursor_pos, const
|
|||
}
|
||||
}
|
||||
|
||||
{
|
||||
using StaticWords = Vector<String, MemoryDomain::Options>;
|
||||
const StaticWords& static_words = options["static_words"].get<StaticWords>();
|
||||
|
||||
for (auto& word : static_words)
|
||||
{
|
||||
if (prefix.empty())
|
||||
matches.push_back(RankedMatch{word, prefix});
|
||||
else if (RankedMatch match{word, prefix})
|
||||
matches.push_back(match);
|
||||
}
|
||||
}
|
||||
for (auto& word : options["static_words"].get<StaticWords>())
|
||||
if (RankedMatch match{word, prefix})
|
||||
matches.emplace_back(match, nullptr);
|
||||
|
||||
unordered_erase(matches, StringView{prefix});
|
||||
std::sort(matches.begin(), matches.end());
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
namespace Kakoune
|
||||
{
|
||||
|
||||
class Value;
|
||||
struct Value;
|
||||
|
||||
class JsonUI : public UserInterface
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user