Filters: correct select_to_previous_WORD

This commit is contained in:
Maxime Coste 2011-10-27 14:09:57 +00:00
parent c532f031d2
commit 5bd61a3f38

View File

@ -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<false>(*begin) != categorize<false>(*(begin+1)))
++begin;
if (categorize<false>(*begin) != categorize<false>(*(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); });