Selectors: select_line selects next line when cursor is on eol

This commit is contained in:
Maxime Coste 2011-10-27 18:57:31 +00:00
parent 0e18db5a88
commit fbe8eed3e4

View File

@ -174,10 +174,13 @@ Selection select_to_previous_WORD(const BufferIterator& cursor)
Selection select_line(const BufferIterator& cursor)
{
BufferIterator first = cursor;
if (*first == '\n' and not first.is_end())
++first;
while (not first.is_begin() and *(first - 1) != '\n')
--first;
BufferIterator last = cursor;
BufferIterator last = first;
while (not (last + 1).is_end() and *last != '\n')
++last;
return Selection(first, last);