Move get_word_db to word_db.cc
This commit is contained in:
parent
e207bd30d4
commit
f545ff7727
|
@ -79,15 +79,6 @@ void option_from_string(StringView str, InsertCompleterDesc& opt)
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
WordDB& get_word_db(const Buffer& buffer)
|
|
||||||
{
|
|
||||||
static const ValueId word_db_id = get_free_value_id();
|
|
||||||
Value& cache_val = buffer.values()[word_db_id];
|
|
||||||
if (not cache_val)
|
|
||||||
cache_val = Value(WordDB{buffer});
|
|
||||||
return cache_val.as<WordDB>();
|
|
||||||
}
|
|
||||||
|
|
||||||
template<bool other_buffers>
|
template<bool other_buffers>
|
||||||
InsertCompletion complete_word(const SelectionList& sels,
|
InsertCompletion complete_word(const SelectionList& sels,
|
||||||
const OptionManager& options,
|
const OptionManager& options,
|
||||||
|
|
|
@ -10,6 +10,15 @@ namespace Kakoune
|
||||||
|
|
||||||
using WordList = Vector<StringView>;
|
using WordList = Vector<StringView>;
|
||||||
|
|
||||||
|
WordDB& get_word_db(const Buffer& buffer)
|
||||||
|
{
|
||||||
|
static const ValueId word_db_id = get_free_value_id();
|
||||||
|
Value& cache_val = buffer.values()[word_db_id];
|
||||||
|
if (not cache_val)
|
||||||
|
cache_val = Value(WordDB{buffer});
|
||||||
|
return cache_val.as<WordDB>();
|
||||||
|
}
|
||||||
|
|
||||||
static WordList get_words(StringView content, ConstArrayView<Codepoint> extra_word_chars)
|
static WordList get_words(StringView content, ConstArrayView<Codepoint> extra_word_chars)
|
||||||
{
|
{
|
||||||
WordList res;
|
WordList res;
|
||||||
|
|
|
@ -48,6 +48,8 @@ private:
|
||||||
Lines m_lines;
|
Lines m_lines;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
WordDB& get_word_db(const Buffer& buffer);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // word_db_hh_INCLUDED
|
#endif // word_db_hh_INCLUDED
|
||||||
|
|
Loading…
Reference in New Issue
Block a user