From 7b09b34cab0a1127fba1e20ea44d2f90bc8b85da Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 22 Nov 2011 18:58:05 +0000 Subject: [PATCH] Selectors: fix select_whole_lines --- src/selectors.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/selectors.cc b/src/selectors.cc index 966281c7..bc38abce 100644 --- a/src/selectors.cc +++ b/src/selectors.cc @@ -287,11 +287,12 @@ SelectionList select_whole_lines(const Selection& selection) BufferIterator& to_line_start = first <= last ? first : last; BufferIterator& to_line_end = first <= last ? last : first; + --to_line_start; 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); }); - if (to_line_start != to_line_end) - ++to_line_start; SelectionList result; result.push_back(Selection(first, last));