From 1d7a481e8107c9f32c8fa139dea4f53a8b8cbc51 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 17 Apr 2014 19:33:49 +0100 Subject: [PATCH] word completion ignore the word on which the cursor is present --- src/input_handler.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/input_handler.cc b/src/input_handler.cc index 802f047b..037bcdcf 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -771,11 +771,17 @@ public: String prefix{begin, end}; + while (end != buffer.end() and is_word(*end)) + ++end; + + String current_word{begin, end}; std::unordered_set matches; auto bufmatches = get_word_db(buffer).find_prefix(prefix); matches.insert(bufmatches.begin(), bufmatches.end()); + matches.erase(current_word); + if (other_buffers) { for (const auto& buf : BufferManager::instance())