summaryrefslogtreecommitdiff
path: root/src/normal.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/normal.zig')
-rw-r--r--src/normal.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/normal.zig b/src/normal.zig
index 8c5f232d..09e06b13 100644
--- a/src/normal.zig
+++ b/src/normal.zig
@@ -110,7 +110,8 @@ pub fn applySelRegex(p: *Pardes, pane: *Pane, t: *Text, pat: []const u8, split:
var at = from;
var piece = from; // split: where the next piece begins
while (at < to and m < Text.max_selections) {
- const hit_at = re.find(hay_all, at, to, to) orelse break;
+ // A search too slow to finish keeps what it found so far.
+ const hit_at = (re.find(hay_all, at, to, to) catch break) orelse break;
if (split) {
out[m] = .{ .anchor = piece, .head = hit_at.start };
m += 1;
@@ -127,7 +128,7 @@ pub fn applySelRegex(p: *Pardes, pane: *Pane, t: *Text, pat: []const u8, split:
m += 1;
}
}
- }
+ } else |_| {}
if (m == 0) {
// the text CAN move under an armed prompt (a tag chord runs a
// builtin), and these are raw offsets into the surface as it was