Selectors: fix select_line on the last line

This commit is contained in:
Maxime Coste 2011-12-02 18:56:18 +00:00
parent 5821995054
commit b1daf8de16

View File

@ -181,7 +181,7 @@ 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()) if (*first == '\n' and not (first + 1).is_end())
++first; ++first;
while (not first.is_begin() and *(first - 1) != '\n') while (not first.is_begin() and *(first - 1) != '\n')