Fix is_word ambiguous overload

This commit is contained in:
Maxime Coste 2016-04-09 07:57:55 +01:00
parent c768ff9b6f
commit c51ca6b3fa

View File

@ -89,9 +89,10 @@ InsertCompletion complete_word(const SelectionList& sels, const OptionManager& o
IdMap<int> sel_word_counts; IdMap<int> sel_word_counts;
for (int i = 0; i < sels.size(); ++i) for (int i = 0; i < sels.size(); ++i)
{ {
auto end = Utf8It{buffer.iterator_at(sels[i].cursor()), buffer}; Utf8It end{buffer.iterator_at(sels[i].cursor()), buffer};
auto begin = end-1; Utf8It begin = end-1;
if (not skip_while_reverse(begin, buffer.begin(), is_word)) if (not skip_while_reverse(begin, buffer.begin(),
[](Codepoint c) { return is_word(c); }))
++begin; ++begin;
if (i == sels.main_index()) if (i == sels.main_index())
@ -100,7 +101,7 @@ InsertCompletion complete_word(const SelectionList& sels, const OptionManager& o
prefix = buffer.string(word_begin, end.base().coord()); prefix = buffer.string(word_begin, end.base().coord());
} }
skip_while(end, buffer.end(), is_word); skip_while(end, buffer.end(), [](Codepoint c) { return is_word(c); });
auto word = buffer.string(begin.base().coord(), end.base().coord()); auto word = buffer.string(begin.base().coord(), end.base().coord());
++sel_word_counts[word]; ++sel_word_counts[word];