summaryrefslogtreecommitdiff
path: root/src/normal.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/normal.zig')
-rw-r--r--src/normal.zig11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/normal.zig b/src/normal.zig
index 192fd933..a77f27a7 100644
--- a/src/normal.zig
+++ b/src/normal.zig
@@ -76,13 +76,8 @@ fn startSelRegex(p: *Pardes, pane: *Pane, split: bool) void {
}
pub fn selRegexArmed(pane: *Pane) ?struct { pat: []const u8, split: bool } {
- const prompt_at = switch (pane.prompt) {
- .search => |at| at,
- else => return null,
- };
- if (pane.nsel_snap == 0) return null;
- const tail = pane.tagSlice();
- const armed = tail[@min(prompt_at, tail.len)..];
+ if (pane.prompt != .search or pane.nsel_snap == 0) return null;
+ const armed = pane.input.own orelse "";
const split = std.mem.startsWith(u8, armed, config.split_marker);
if (!split and !std.mem.startsWith(u8, armed, config.select_marker)) return null;
const slash = std.mem.indexOfScalar(u8, armed, '/') orelse return null;
@@ -274,7 +269,7 @@ pub fn replaySels(p: *Pardes, t: *Text, what: Replay) void {
}
t.setRanges(text, rs[0..n], st[0..n], pri, after_expl);
after.into(t);
- t.pane().ensureCursorVisible(); // the view follows the PRIMARY, not the last pass
+ t.show(); // the view follows the PRIMARY, not the last pass
}
pub fn handleNormal(p: *Pardes, t: *Text, key: Key) void {