Fix select_to_previous_word when cursor is on last buffer char
This commit is contained in:
parent
67452c3441
commit
c4de866903
|
@ -131,7 +131,7 @@ template<WordType word_type>
|
||||||
Selection select_to_previous_word(const Buffer& buffer, const Selection& selection)
|
Selection select_to_previous_word(const Buffer& buffer, const Selection& selection)
|
||||||
{
|
{
|
||||||
Utf8Iterator begin = buffer.iterator_at(selection.last());
|
Utf8Iterator begin = buffer.iterator_at(selection.last());
|
||||||
if (begin+1 == buffer.end())
|
if (begin == buffer.begin())
|
||||||
return selection;
|
return selection;
|
||||||
if (categorize<word_type>(*begin) != categorize<word_type>(*(begin-1)))
|
if (categorize<word_type>(*begin) != categorize<word_type>(*(begin-1)))
|
||||||
--begin;
|
--begin;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user