diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-03-05 05:48:10 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-03-05 05:48:10 +1100 |
| commit | fb65fa60f87957b2b4449dd5659d148d00427048 (patch) | |
| tree | b2703c496f62a43ec1a05beb96c036b8bec7476e /src/normal.cc | |
| parent | d9e44dfacf64b7a04aeccf110e2d54bd89f5ecaf (diff) | |
Regex: take the full subject range as a parameter
To allow more general look arounds out of the actual search range,
pass a second range (the actual subject). This allows us to remove
various flags such as PrevAvailable or NotBeginOfSubject, which are
now easy to check from the subject range.
Fixes #1902
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/normal.cc b/src/normal.cc index 882c3986..0a36d059 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -1041,10 +1041,9 @@ void keep(Context& context, NormalParams params) // give more intuitive behaviours in keep use cases. const auto flags = match_flags(is_bol(begin.coord()), false, is_bow(buffer, begin.coord()), - is_eow(buffer, end.coord()), - true, true) | + is_eow(buffer, end.coord())) | RegexExecFlags::AnyMatch; - if (regex_search(begin, end, regex, flags) == matching) + if (regex_search(begin, end, begin, end, regex, flags) == matching) keep.push_back(sel); } if (keep.empty()) |
