diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 17:43:56 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | 5d29c3151e40c05e764a9112d407082df89a19e1 (patch) | |
| tree | 7dfef2c678e64021908d37c5e293a88dea897605 /src/builtins.zig | |
| parent | 63d584a0ba7806759f7139e87f45e411c9a1573d (diff) | |
| download | pardes-5d29c3151e40c05e764a9112d407082df89a19e1.tar.gz pardes-5d29c3151e40c05e764a9112d407082df89a19e1.zip | |
A look takes acme's file:addr and :addr, and one that finds nothing changes nothing
A look at `file:/re/` or `:/re/` searched for the words instead of addressing, and a miss left an empty +Search pane and a cleared selection, while a hit answered the +Search pane on /look. Now an address after a colon (acme look.c:450) is evaluated in the file from its dot; a miss says no match and leaves the panes and the selection alone; a hit reads back as the pane the text is selected in. Both live in lookAt's one flow, so they are one change.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/builtins.zig')
| -rw-r--r-- | src/builtins.zig | 12 |
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 }); } }; |
