From 9beba9006064355f4af1df403b9305cda6d356cf Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 26 Sep 2014 00:27:23 +0100 Subject: [PATCH] Finding next matches start from seleciton min/max instead of cursor uses min for backward serching, max for forward searching. --- src/selectors.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/selectors.hh b/src/selectors.hh index 5107226e..c985cc72 100644 --- a/src/selectors.hh +++ b/src/selectors.hh @@ -261,7 +261,7 @@ bool find_match_in_buffer(const Buffer& buffer, const BufferIterator pos, template Selection find_next_match(const Buffer& buffer, const Selection& sel, const Regex& regex) { - auto begin = buffer.iterator_at(sel.cursor()); + auto begin = buffer.iterator_at(direction == Backward ? sel.min() : sel.max()); auto end = begin; CaptureList captures;