diff options
| author | WormHeamer | 2026-01-01 21:37:44 -0500 |
|---|---|---|
| committer | WormHeamer | 2026-01-01 21:37:44 -0500 |
| commit | 3b48035f5b9475293ff614c2d5193cf525e55a44 (patch) | |
| tree | 7ebac8e75ff462b30fd09614ad7b3b8558b08d6e /main.c | |
| parent | 4853268e16df1789541ea27586c7a4ec8c3786cb (diff) | |
make regex line ends more consistent across chunks
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -681,9 +681,10 @@ int search_next_regex(TxtLoc l, Str src, TxtLoc *out) { return 0; } int match_found = 0; -search_from_start: +search_from_start:; TxtLoc t = l; re_search_start(&s, &re, &e.scratch); + if (at_start(t) || txt_chr(cprev(t)) == '\n') re_search_first_chunk(&s); while (!at_end(t)) { Str chnk = txt_next_chunk(&t); re_search_chunk(&s, chnk.s, chnk.n); @@ -720,6 +721,7 @@ search_from_end: Arena a = e.scratch; re_search_start(&s, &re, &e.scratch); TxtLoc t = l; + if (at_start(t) || txt_chr(cprev(t)) == '\n') re_search_first_chunk(&s); while (!at_end(t)) { TxtLoc p = t; Str chnk = txt_next_chunk(&t); |
