From 0d04bc9214cccce42d74862b31376d49bdda3956 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 09:05:35 -0300 Subject: Let s, S and | pressed in a tag answer for the tag's own text A tag is a text like the body, so selecting on a regex and piping act on the text they are pressed in: a prompt records the text it answers for, the tag keeps the keyboard while it is typed, and a header's prompt goes on the active pane's band. `/` still searches the body from anywhere, as acme's Look from a tag searches the body. Co-Authored-By: Claude Opus 5.5 --- src/builtins.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/builtins.zig') diff --git a/src/builtins.zig b/src/builtins.zig index e9f29102..ffb00ff6 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -483,7 +483,7 @@ pub const Save = struct { const path = std.mem.trim(u8, c.arg orelse "", " \t\r\n"); if (path.len > 0) return exec.saveTo(c.p, c.id, path); if (c.pane.file) |file| if (file.output == null) return exec.saveFile(c.p, c.id); - if (c.pane.file != null or c.pane.isTerminal()) c.p.startPrompt(c.pane, .save); + if (c.pane.file != null or c.pane.isTerminal()) c.p.startPrompt(c.pane, &c.pane.body, .save); } }; @@ -717,7 +717,7 @@ pub const Find = struct { 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); - c.p.startPrompt(c.pane, .{ .search = config.find_marker }); + c.p.startPrompt(c.pane, &c.pane.body, .{ .search = config.find_marker }); } }; @@ -730,7 +730,7 @@ pub const Grep = struct { 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); - c.p.startPrompt(c.pane, .{ .search = config.grep_marker }); + c.p.startPrompt(c.pane, &c.pane.body, .{ .search = config.grep_marker }); } }; @@ -894,7 +894,7 @@ pub const Rename = struct { pub fn run(c: Ctx) void { const a = std.mem.trim(u8, c.arg orelse "", " \t\r\n"); if (a.len > 0) return c.p.lspRequest(c.id, .rename, a); - c.p.startPrompt(c.pane, .{ .search = config.rename_marker }); + c.p.startPrompt(c.pane, &c.pane.body, .{ .search = config.rename_marker }); } }; @@ -903,7 +903,7 @@ pub const WsSymbols = struct { pub fn run(c: Ctx) void { const a = std.mem.trim(u8, c.arg orelse "", " \t\r\n"); if (a.len > 0) return c.p.lspRequest(c.id, .workspace_symbols, a); - c.p.startPrompt(c.pane, .{ .search = config.symbol_marker }); + c.p.startPrompt(c.pane, &c.pane.body, .{ .search = config.symbol_marker }); } }; -- cgit v1.3