From 7a04efb6d9fc9bb5a9e568988e5a08a2a37d6867 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 23 Oct 2016 21:03:15 +0100 Subject: [PATCH] Force wrapping when searching from buffer end Fixes #868 --- src/selectors.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;