summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-09-26 00:27:23 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-09-26 00:27:23 +0100
commit9beba9006064355f4af1df403b9305cda6d356cf (patch)
tree0fee75afd79e83086e931b09450e1ae0af151b59 /src
parentbfef8fd5aa87e75bcd153db431cd988c426c1357 (diff)
Finding next matches start from seleciton min/max instead of cursor
uses min for backward serching, max for forward searching.
Diffstat (limited to 'src')
-rw-r--r--src/selectors.hh2
1 files changed, 1 insertions, 1 deletions
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<Direction direction>
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;