From 5bd61a3f3809ca0409aa593eebf7daa34534f81e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 27 Oct 2011 14:09:57 +0000 Subject: [PATCH] Filters: correct select_to_previous_WORD --- src/selectors.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/selectors.cc b/src/selectors.cc index e54704e6..0c4d0d41 100644 --- a/src/selectors.cc +++ b/src/selectors.cc @@ -160,13 +160,11 @@ Selection select_to_next_WORD_end(const BufferIterator& cursor) Selection select_to_previous_WORD(const BufferIterator& cursor) { BufferIterator begin = cursor; - if (categorize(*begin) != categorize(*(begin+1))) - ++begin; + if (categorize(*begin) != categorize(*(begin-1))) + --begin; skip_while_reverse(begin, is_eol); - - BufferIterator end = begin+1; - + BufferIterator end = begin; skip_while_reverse(end, is_blank); skip_while_reverse(end, [] (char c) { return !is_blank(c) and !is_eol(c); });