Fix select_whole_paragraph so that buffer end is not selected

This commit is contained in:
Maxime Coste 2013-06-03 14:27:51 +02:00
parent 24ffd6abae
commit b198f6a5fb

View File

@ -75,7 +75,7 @@ void skip_while_reverse(Iterator& it, T condition)
Range utf8_range(const Utf8Iterator& first, const Utf8Iterator& last) Range utf8_range(const Utf8Iterator& first, const Utf8Iterator& last)
{ {
return Range{first.underlying_iterator(), last.underlying_iterator()}; return {first.underlying_iterator(), last.underlying_iterator()};
} }
} }
@ -480,11 +480,11 @@ Selection select_whole_paragraph(const Buffer& buffer, const Selection& selectio
{ {
if (not (flags & ObjectFlags::Inner)) if (not (flags & ObjectFlags::Inner))
skip_while(last, is_eol); skip_while(last, is_eol);
--last;
break; break;
} }
++last; ++last;
} }
--last;
} }
return (flags & ObjectFlags::ToEnd) ? Selection{first, last} return (flags & ObjectFlags::ToEnd) ? Selection{first, last}
: Selection{last, first}; : Selection{last, first};