From e02cb4e5bdcdd10429c02d65af06bb4dfb8a96cb Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 9 Jan 2012 14:22:52 +0000 Subject: [PATCH] Selectors: select_next_match starts from cursor+1 so searching effectively starts on the character after current selection end. Which makes repeating 'n' on a one character match work. --- src/selectors.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/selectors.cc b/src/selectors.cc index 342b2170..3aaee02a 100644 --- a/src/selectors.cc +++ b/src/selectors.cc @@ -367,7 +367,7 @@ Selection select_next_match(const BufferIterator& cursor, { boost::match_results matches; - if (boost::regex_search(cursor, cursor.buffer().end(), matches, + if (boost::regex_search(cursor+1, cursor.buffer().end(), matches, ex)) { begin = matches[0].first; @@ -375,7 +375,7 @@ Selection select_next_match(const BufferIterator& cursor, std::copy(matches.begin(), matches.end(), std::back_inserter(captures)); } - else if (boost::regex_search(cursor.buffer().begin(), cursor, matches, + else if (boost::regex_search(cursor.buffer().begin(), cursor+1, matches, ex)) { begin = matches[0].first;