summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 09:05:35 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit0d04bc9214cccce42d74862b31376d49bdda3956 (patch)
treeb45286fe0847b08c76e6abd562f6e2f985322e17 /src/builtins.zig
parent66c0106691e4de925011f314200e85ee265b7861 (diff)
downloadpardes-0d04bc9214cccce42d74862b31376d49bdda3956.tar.gz
pardes-0d04bc9214cccce42d74862b31376d49bdda3956.zip
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 <[email protected]>
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig10
1 files changed, 5 insertions, 5 deletions
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 });
}
};