Filter non-extra_word_chars completion candidates using Codepoints

Fixes #3010
This commit is contained in:
Maxime Coste 2019-07-09 19:29:19 +10:00
parent c2e43ee42c
commit be3d0f8b33
5 changed files with 9 additions and 2 deletions

View File

@ -136,7 +136,10 @@ InsertCompletion complete_word(const SelectionList& sels,
continue;
for (auto& m : get_word_db(*buf).find_matching(prefix) |
// filter out words that are not considered words for the current buffer
filter([&](auto& rm) { return std::all_of(rm.candidate().begin(), rm.candidate().end(),
filter([&](auto& rm) {
auto&& c = rm.candidate();
return std::all_of(utf8::iterator{c.begin(), c},
utf8::iterator{c.end(), c},
is_word_pred); }))
matches.push_back({ m, buf.get() });
}

View File

@ -0,0 +1 @@
:e other<ret>iword░<esc><ret><c-o>A<c-x>W<c-n>

View File

@ -0,0 +1 @@
word░

View File

@ -0,0 +1 @@
set global extra_word_chars ░