diff --git a/src/insert_completer.cc b/src/insert_completer.cc index b49fa9bc..92adf361 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -136,8 +136,11 @@ 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(), - is_word_pred); })) + 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() }); } } diff --git a/test/regression/3010-extra_word_chars-fails-with-other-buffers/cmd b/test/regression/3010-extra_word_chars-fails-with-other-buffers/cmd new file mode 100644 index 00000000..c50e70f0 --- /dev/null +++ b/test/regression/3010-extra_word_chars-fails-with-other-buffers/cmd @@ -0,0 +1 @@ +:e otheriword░AW diff --git a/test/regression/3010-extra_word_chars-fails-with-other-buffers/in b/test/regression/3010-extra_word_chars-fails-with-other-buffers/in new file mode 100644 index 00000000..1c2a6d45 --- /dev/null +++ b/test/regression/3010-extra_word_chars-fails-with-other-buffers/in @@ -0,0 +1 @@ +wo diff --git a/test/regression/3010-extra_word_chars-fails-with-other-buffers/out b/test/regression/3010-extra_word_chars-fails-with-other-buffers/out new file mode 100644 index 00000000..3959b4e9 --- /dev/null +++ b/test/regression/3010-extra_word_chars-fails-with-other-buffers/out @@ -0,0 +1 @@ +word░ diff --git a/test/regression/3010-extra_word_chars-fails-with-other-buffers/rc b/test/regression/3010-extra_word_chars-fails-with-other-buffers/rc new file mode 100644 index 00000000..26d072af --- /dev/null +++ b/test/regression/3010-extra_word_chars-fails-with-other-buffers/rc @@ -0,0 +1 @@ +set global extra_word_chars ░