Selectors: fix select_whole_lines

This commit is contained in:
Maxime Coste 2011-11-22 18:58:05 +00:00
parent 2f8f71db67
commit 7b09b34cab

View File

@ -287,11 +287,12 @@ SelectionList select_whole_lines(const Selection& selection)
BufferIterator& to_line_start = first <= last ? first : last; BufferIterator& to_line_start = first <= last ? first : last;
BufferIterator& to_line_end = first <= last ? last : first; BufferIterator& to_line_end = first <= last ? last : first;
--to_line_start;
skip_while_reverse(to_line_start, [](char cur) { return not is_eol(cur); }); skip_while_reverse(to_line_start, [](char cur) { return not is_eol(cur); });
++to_line_start;
skip_while(to_line_end, [](char cur) { return not is_eol(cur); }); skip_while(to_line_end, [](char cur) { return not is_eol(cur); });
if (to_line_start != to_line_end)
++to_line_start;
SelectionList result; SelectionList result;
result.push_back(Selection(first, last)); result.push_back(Selection(first, last));