summaryrefslogtreecommitdiff
path: root/src/ninep/cols.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-30 21:19:57 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commit137dc2ea4be0fc5baf4cab1d8a757ce426e5cbb2 (patch)
treeb4dba1252b54a135c5afe972bf4193f31219703a /src/ninep/cols.zig
parentf02c10bfa6d02d305ddb6d7a28b12c40035274c7 (diff)
downloadpardes-137dc2ea4be0fc5baf4cab1d8a757ce426e5cbb2.tar.gz
pardes-137dc2ea4be0fc5baf4cab1d8a757ce426e5cbb2.zip
Views generated by each read stat 0, as acme's do: data, xdata, index, layout, recent and listeners; fs.md says which files have real lengths
A stat of index, layout, recent or listeners built the whole view to count it, and data and xdata reported the body's length though a read answers what addr selects. Those now stat 0, as screen and pane/new already did, and fs.md lists the files whose length is real and says to read the rest to the end. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/cols.zig')
-rw-r--r--src/ninep/cols.zig10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/ninep/cols.zig b/src/ninep/cols.zig
index 6828612c..b2e62d28 100644
--- a/src/ninep/cols.zig
+++ b/src/ninep/cols.zig
@@ -43,13 +43,6 @@ pub fn writeLayout(p: *Pardes, w: *std.Io.Writer) !void {
if (p.activeColumn() orelse active) |c| try w.print("active {d}\n", .{layout.columnSerial(p, c)}) else try w.writeAll("active -\n");
}
-pub fn layoutLen(p: *Pardes) u64 {
- var buf: [256]u8 = undefined;
- var counting: std.Io.Writer.Discarding = .init(&buf);
- writeLayout(p, &counting.writer) catch return 0;
- return counting.fullCount();
-}
-
/// A header by its node: the workspace's (`serial` null) or the column's
/// with that serial; null when that column has closed.
const Header = struct { text: *Text, col: ?usize };
@@ -532,7 +525,8 @@ test "layout lists each column's place, panes and state, and the active one" {
// Newcol gives the new, empty column's tag the keyboard.
try testing.expect(std.mem.indexOf(u8, text, "current empty\n") != null);
try testing.expect(std.mem.endsWith(u8, text, try std.fmt.bufPrint(&want, "active {d}\n", .{new_serial})));
- try testing.expectEqual(@as(u64, text.len), th.call(p, .{ .tag = 1, .op = .getattr, .node = layout_node }).reply.attr.size);
+ try testing.expect(text.len > 0);
+ try testing.expectEqual(@as(u64, 0), th.call(p, .{ .tag = 1, .op = .getattr, .node = layout_node }).reply.attr.size); // generated by each read
// /index says which column each pane is in, by its serial, last.
try testing.expect(std.mem.endsWith(u8, th.rd(p, @intFromEnum(tree.TopFile.index), 0, 4096).bytes, try std.fmt.bufPrint(&want, " {d}\n", .{first_serial})));
try testing.expect(th.logHas(p, try std.fmt.bufPrint(&want, "newcol {d}\n", .{new_serial})));