diff options
author | bptato <nincsnevem662@gmail.com> | 2022-07-25 18:42:24 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-07-25 18:42:24 +0200 |
commit | 7469a7428807d2ffff0000d54d12e209a189d973 (patch) | |
tree | bb36c12400e475d7249404c422dbbac7ff8b84a7 /src/js | |
parent | fce9adc58cc762d6f70c1d34ac97efddd171edc7 (diff) | |
download | chawan-7469a7428807d2ffff0000d54d12e209a189d973.tar.gz |
Incremental search fixes
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/regex.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/js/regex.nim b/src/js/regex.nim index 75ff7535..dcaf1729 100644 --- a/src/js/regex.nim +++ b/src/js/regex.nim @@ -127,12 +127,12 @@ proc exec*(regex: Regex, str: string, start = 0): RegexResult = var e8 = 0 var i = 0 var r: Rune - while i < s: + while i < s and i < ustr.len: fastRuneAt(ustr, i, r) let si = r.size() s8 += si e8 += si - while i < e: + while i < e and i < ustr.len: fastRuneAt(ustr, i, r) e8 += r.size() result.captures.add((s8, e8)) |