diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2020-01-24 10:45:42 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2020-01-24 10:53:39 +0100 |
| commit | b416a912c7be9718934778f66317e974fd4aa0a3 (patch) | |
| tree | 42cbfdc12a92515ee91a948c7f8a31c29ad3e749 | |
| parent | 935d30a8b8a1ef1b1ae577271b497b841bb0f162 (diff) | |
| download | vis-b416a912c7be9718934778f66317e974fd4aa0a3.tar.gz vis-b416a912c7be9718934778f66317e974fd4aa0a3.tar.xz | |
text: unconditionally use REG_NOTEOL for backward searches
This fixes empty backward searches ?$ starting at the line end.
| -rw-r--r-- | text-motions.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/text-motions.c b/text-motions.c index 067c9c8..b62dc23 100644 --- a/text-motions.c +++ b/text-motions.c @@ -634,9 +634,7 @@ size_t text_search_backward(Text *txt, size_t pos, Regex *regex) { size_t start = 0; size_t end = pos; RegexMatch match[1]; - char c; - int flags = text_byte_get(txt, end, &c) && c == '\n' ? 0 : REG_NOTEOL; - bool found = !text_search_range_backward(txt, start, end, regex, 1, match, flags); + bool found = !text_search_range_backward(txt, start, end, regex, 1, match, REG_NOTEOL); if (!found) { end = text_size(txt); |
