From f545ff7727966cba62c0912bb66d032b668e7813 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 15 Apr 2018 13:21:57 +1000 Subject: [PATCH] Move get_word_db to word_db.cc --- src/insert_completer.cc | 9 --------- src/word_db.cc | 9 +++++++++ src/word_db.hh | 2 ++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/insert_completer.cc b/src/insert_completer.cc index 225ac5c9..52f6d770 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -79,15 +79,6 @@ void option_from_string(StringView str, InsertCompleterDesc& opt) 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(); -} - template InsertCompletion complete_word(const SelectionList& sels, const OptionManager& options, diff --git a/src/word_db.cc b/src/word_db.cc index a5d59e4c..c9bd226a 100644 --- a/src/word_db.cc +++ b/src/word_db.cc @@ -10,6 +10,15 @@ namespace Kakoune using WordList = Vector; +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(); +} + static WordList get_words(StringView content, ConstArrayView extra_word_chars) { WordList res; diff --git a/src/word_db.hh b/src/word_db.hh index 789d989e..08234257 100644 --- a/src/word_db.hh +++ b/src/word_db.hh @@ -48,6 +48,8 @@ private: Lines m_lines; }; +WordDB& get_word_db(const Buffer& buffer); + } #endif // word_db_hh_INCLUDED