From ee800ad778c3fe31b644470ef1255837413c480c Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 18 Mar 2013 23:47:18 +0100 Subject: [PATCH] select_to_{,reverse}: search on other lines if needed --- src/selectors.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/selectors.cc b/src/selectors.cc index 420ea6d8..77102d59 100644 --- a/src/selectors.cc +++ b/src/selectors.cc @@ -290,8 +290,8 @@ Selection select_to(const Selection& selection, do { ++end; - skip_while(end, [c](Codepoint cur) { return not is_eol(cur) and cur != c; }); - if (is_end(end) or is_eol(*end)) + skip_while(end, [c](Codepoint cur) { return cur != c; }); + if (is_end(end)) return selection; } while (--count > 0); @@ -307,8 +307,8 @@ Selection select_to_reverse(const Selection& selection, do { --end; - skip_while_reverse(end, [c](Codepoint cur) { return not is_eol(cur) and cur != c; }); - if (is_begin(end) or is_eol(*end)) + skip_while_reverse(end, [c](Codepoint cur) { return cur != c; }); + if (is_begin(end)) return selection; } while (--count > 0);