From 46c614c4a271b09461aade54b39d15f381a51360 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 16 Feb 2012 14:28:22 +0000 Subject: [PATCH] fix skip_while --- src/selectors.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/selectors.cc b/src/selectors.cc index d4246ee5..f6ca36ca 100644 --- a/src/selectors.cc +++ b/src/selectors.cc @@ -60,7 +60,7 @@ bool skip_while(BufferIterator& it, T condition) { while (not it.is_end() and condition(*it)) ++it; - return condition(*it); + return not it.is_end() and condition(*it); } template @@ -68,7 +68,7 @@ bool skip_while_reverse(BufferIterator& it, T condition) { while (not it.is_begin() and condition(*it)) --it; - return condition(*it); + return not it.is_end() and condition(*it); } SelectionAndCaptures select_to_next_word(const Selection& selection)