summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-10-23 21:03:15 +0100
committerMaxime Coste <frrrwww@gmail.com>2016-10-23 21:03:15 +0100
commit7a04efb6d9fc9bb5a9e568988e5a08a2a37d6867 (patch)
tree1f53c470df91ee252d1ebb95a14d6748f06f0c19 /src
parent2809ce00dee77f219275d79ae5e245f6801d5416 (diff)
Force wrapping when searching from buffer end
Fixes #868
Diffstat (limited to 'src')
-rw-r--r--src/selectors.hh3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/selectors.hh b/src/selectors.hh
index f9be9247..61b01575 100644
--- a/src/selectors.hh
+++ b/src/selectors.hh
@@ -224,7 +224,8 @@ bool find_match_in_buffer(const Buffer& buffer, const BufferIterator pos,
wrapped = false;
if (direction == Forward)
{
- if (regex_search(pos, buffer.end(), matches, ex,
+ if (pos != buffer.end() and
+ regex_search(pos, buffer.end(), matches, ex,
match_flags(is_bol(pos.coord()), true,
is_bow(buffer, pos.coord()), true)))
return true;