Selectors: select_line selects next line when cursor is on eol
This commit is contained in:
parent
0e18db5a88
commit
fbe8eed3e4
|
@ -174,10 +174,13 @@ Selection select_to_previous_WORD(const BufferIterator& cursor)
|
||||||
Selection select_line(const BufferIterator& cursor)
|
Selection select_line(const BufferIterator& cursor)
|
||||||
{
|
{
|
||||||
BufferIterator first = cursor;
|
BufferIterator first = cursor;
|
||||||
|
if (*first == '\n' and not first.is_end())
|
||||||
|
++first;
|
||||||
|
|
||||||
while (not first.is_begin() and *(first - 1) != '\n')
|
while (not first.is_begin() and *(first - 1) != '\n')
|
||||||
--first;
|
--first;
|
||||||
|
|
||||||
BufferIterator last = cursor;
|
BufferIterator last = first;
|
||||||
while (not (last + 1).is_end() and *last != '\n')
|
while (not (last + 1).is_end() and *last != '\n')
|
||||||
++last;
|
++last;
|
||||||
return Selection(first, last);
|
return Selection(first, last);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user