word completion ignore the word on which the cursor is present

This commit is contained in:
Maxime Coste 2014-04-17 19:33:49 +01:00
parent 2b997719c3
commit 1d7a481e81

View File

@ -771,11 +771,17 @@ public:
String prefix{begin, end}; String prefix{begin, end};
while (end != buffer.end() and is_word(*end))
++end;
String current_word{begin, end};
std::unordered_set<String> matches; std::unordered_set<String> matches;
auto bufmatches = get_word_db(buffer).find_prefix(prefix); auto bufmatches = get_word_db(buffer).find_prefix(prefix);
matches.insert(bufmatches.begin(), bufmatches.end()); matches.insert(bufmatches.begin(), bufmatches.end());
matches.erase(current_word);
if (other_buffers) if (other_buffers)
{ {
for (const auto& buf : BufferManager::instance()) for (const auto& buf : BufferManager::instance())