summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index a755969b..97f7817f 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -1109,8 +1109,10 @@ pub const Find = struct {
pub const output: OutputTraits = .{ .name = config.search_buffer, .steps = true };
pub fn run(c: Ctx) void {
const pat = std.mem.trim(u8, c.arg orelse "", " \t\r\n");
- if (pat.len > 0) return look.runSearch(c.p, c.id, pat, .find, .top) catch |err|
- c.p.reportError(c.id, "find", err);
+ if (pat.len > 0) {
+ _ = look.runSearch(c.p, c.id, pat, .find, .top, true) catch |err| c.p.reportError(c.id, "find", err);
+ return;
+ }
c.p.startPrompt(c.pane, &c.pane.body, .{ .search = config.find_marker });
}
};
@@ -1123,8 +1125,10 @@ pub const Grep = struct {
pub const output: OutputTraits = .{ .name = config.search_buffer, .steps = true, .locations = true };
pub fn run(c: Ctx) void {
const pat = std.mem.trim(u8, c.arg orelse "", " \t\r\n");
- if (pat.len > 0) return look.runSearch(c.p, c.id, pat, .grep, .top) catch |err|
- c.p.reportError(c.id, "grep", err);
+ if (pat.len > 0) {
+ _ = look.runSearch(c.p, c.id, pat, .grep, .top, true) catch |err| c.p.reportError(c.id, "grep", err);
+ return;
+ }
c.p.startPrompt(c.pane, &c.pane.body, .{ .search = config.grep_marker });
}
};