summaryrefslogtreecommitdiff
path: root/src/ninep/pane.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 06:18:15 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit399d005f1997f23d50f36829946f2d5d7a98b928 (patch)
tree1200840db782be0e1b85e44734596e3e065ed6fc /src/ninep/pane.zig
parentc78641fdbe931ca2e6e87eb3e001bd021c1eba3f (diff)
downloadpardes-399d005f1997f23d50f36829946f2d5d7a98b928.tar.gz
pardes-399d005f1997f23d50f36829946f2d5d7a98b928.zip
A pane from pane/new is the session's directory's scratch, not the last active pane's
No pane asked for it, so borrowing the directory of whichever pane last had the keyboard named it after an accident; acme's new window has acme's directory. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/pane.zig')
-rw-r--r--src/ninep/pane.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig
index 899d8528..61642999 100644
--- a/src/ninep/pane.zig
+++ b/src/ninep/pane.zig
@@ -1143,11 +1143,15 @@ test "relative names use the file directory and can name a new target" {
try testing.expect(dirtyOf(pane));
}
-test "relative names follow inherited scratch and virtual directories" {
+test "relative names follow a pane/new scratch's session directory and virtual directories" {
const p = try withFile(testing.allocator, "source body\n");
defer p.deinit();
const source = p.panes[0].?;
- try testing.expectEqual(Status.ok, wr(p, Node.of(source.serial, .name), "/project/src/source.zig\n").reply.status);
+ try testing.expectEqual(Status.ok, wr(p, Node.of(source.serial, .name), "/elsewhere/source.zig\n").reply.status);
+ // pane/new's scratch is the session's, not the active pane's.
+ const session = "/project/src";
+ @memcpy(p.session_dir[0..session.len], session);
+ p.session_dir_len = session.len;
const serial = try th.newPane(p);
const scratch = p.panes[p.paneBySerial(serial).?].?;
const name = Node.of(serial, .name);