diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 06:18:15 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | 399d005f1997f23d50f36829946f2d5d7a98b928 (patch) | |
| tree | 1200840db782be0e1b85e44734596e3e065ed6fc /src/ninep/tree.zig | |
| parent | c78641fdbe931ca2e6e87eb3e001bd021c1eba3f (diff) | |
| download | pardes-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/tree.zig')
| -rw-r--r-- | src/ninep/tree.zig | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig index af1c589d..69b89f53 100644 --- a/src/ninep/tree.zig +++ b/src/ninep/tree.zig @@ -1326,6 +1326,10 @@ test "opening /pane/new makes a pane and removing one closes it" { const id = p.paneBySerial(serial).?; try testing.expectEqualStrings("", p.panes[id].?.file.?.content); + // Its directory is the session's, not that of /test.txt, the pane + // that happened to have the keyboard. + var named: [4096]u8 = undefined; + try testing.expectEqualStrings(try std.fmt.bufPrint(&named, "{s}/+New", .{p.sessionDir()}), p.panes[id].?.file.?.path); _ = wr(p, Node.of(serial, .body), "hi"); // A second open is a second pane, and releasing a clone fid leaves the @@ -1433,8 +1437,9 @@ test "editor paths resolve to the same nodes the wire serves" { test "at the pane cap, pane/new, look and New each say so, and look reads back empty" { const p = try th.withFile(testing.allocator, "x\n"); defer p.deinit(); - // Tall enough that the column holds every pane at its tag and two rows. - p.update(.{ .resize = .{ .cols = 80, .rows = pardes.MAX_PANES * 4 } }); + // Tall enough that the column holds every pane at its tag and two rows, + // and wide enough that each tag, the session directory's +New, is one. + p.update(.{ .resize = .{ .cols = 400, .rows = pardes.MAX_PANES * 4 } }); const new = @intFromEnum(TopFile.new); while (p.freeSlot() != null) try testing.expectEqual(Status.ok, call(p, .{ .tag = 1, .op = .open, .node = new }).reply.status); var want: [64]u8 = undefined; |
