From 3612eb50e559b20dc425a1073182aa0a2a8f49ce Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 9 Jun 2017 14:21:18 +0100 Subject: [PATCH] Fix bug in word completer A bug could be triggered in the word completer when a multiselection would trigger word completion with one selection being at buffer first character. --- src/insert_completer.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/insert_completer.cc b/src/insert_completer.cc index d77f7a20..05eb6785 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -97,7 +97,8 @@ InsertCompletion complete_word(const SelectionList& sels, const OptionManager& o { Utf8It end{buffer.iterator_at(sels[i].cursor()), buffer}; Utf8It begin = end-1; - if (not skip_while_reverse(begin, buffer.begin(), is_word_pred)) + if (not skip_while_reverse(begin, buffer.begin(), is_word_pred) and + begin < end) // (begin might == end if end == buffer.begin()) ++begin; if (i == sels.main_index())