fix skip_while

This commit is contained in:
Maxime Coste 2012-02-16 14:28:22 +00:00
parent 7026693ecd
commit 46c614c4a2

View File

@ -60,7 +60,7 @@ bool skip_while(BufferIterator& it, T condition)
{ {
while (not it.is_end() and condition(*it)) while (not it.is_end() and condition(*it))
++it; ++it;
return condition(*it); return not it.is_end() and condition(*it);
} }
template<typename T> template<typename T>
@ -68,7 +68,7 @@ bool skip_while_reverse(BufferIterator& it, T condition)
{ {
while (not it.is_begin() and condition(*it)) while (not it.is_begin() and condition(*it))
--it; --it;
return condition(*it); return not it.is_end() and condition(*it);
} }
SelectionAndCaptures select_to_next_word(const Selection& selection) SelectionAndCaptures select_to_next_word(const Selection& selection)