summaryrefslogtreecommitdiff
path: root/src/Output.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-30 12:03:44 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commitd6c877f55669869bc4c360e6d94563ded778d26d (patch)
treec9c8ec537b97445c60936135b359d03434c669d6 /src/Output.zig
parent946e7c6c00c1ecc20c1e529608423ac9caa6c6ba (diff)
downloadpardes-d6c877f55669869bc4c360e6d94563ded778d26d.tar.gz
pardes-d6c877f55669869bc4c360e6d94563ded778d26d.zip
Help and Find from the workspace or a column tag act in the session's directory, not the keyboard pane's
New, Tty and commands clicked in a tag no pane owns ran in the session's directory, but Help named its +Help after the pane with the keyboard, and Find walked that pane's directory. So the same click gave different results depending on which pane was focused. Both now take the session's directory from a header, through execDir as the others do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/Output.zig')
-rw-r--r--src/Output.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Output.zig b/src/Output.zig
index 65f6bfe4..545637b3 100644
--- a/src/Output.zig
+++ b/src/Output.zig
@@ -916,7 +916,7 @@ pub fn resetBody(p: *Pardes, pane: *Pane) void {
fn openRead(p: *Pardes, id: usize, from: Origin, arg: []const u8, content: []u8) !void {
errdefer p.gpa.free(content);
- const pane = p.panes[id] orelse return error.MissingPane;
+ if (p.panes[id] == null) return error.MissingPane;
for (p.panes, 0..) |slot, i| {
const hp = slot orelse continue;
const hf = if (hp.file) |*f| f else continue;
@@ -928,7 +928,9 @@ fn openRead(p: *Pardes, id: usize, from: Origin, arg: []const u8, content: []u8)
p.active = i;
return;
}
- const dir = if (pane.file) |f| (std.fs.path.dirname(f.path) orelse "/") else pane.cwdSlice();
+ // Where the word ran: the pane's directory, or from a column's or the
+ // workspace's tag, the session's.
+ const dir = p.execDir(id);
const free = p.freeSlot() orelse return error.NoPaneSlots;
_ = try open(p, free, dir, from, arg, content);
exec.placeNew(p, id, id, free, if (from == .errors) .errors else .doc);