summaryrefslogtreecommitdiff
path: root/src/ninep/tree.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/ninep/tree.zig')
-rw-r--r--src/ninep/tree.zig23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig
index c0ace5be..a7f3f2a4 100644
--- a/src/ninep/tree.zig
+++ b/src/ninep/tree.zig
@@ -253,13 +253,6 @@ pub const TopFile = enum(u5) {
pub const root: u64 = @intFromEnum(TopFile.root);
-fn recentLen(p: *Pardes) u64 {
- var buf: [64]u8 = undefined;
- var counting: std.Io.Writer.Discarding = .init(&buf);
- pardes.panes.Output.recentText(p, &counting.writer, false) catch return 0;
- return counting.fullCount();
-}
-
/// Declaration order is readdir order.
pub const PaneFile = enum(u5) {
dir = 0,
@@ -643,23 +636,19 @@ fn attrOf(p: *Pardes, target: Target) ?Reply.Attr {
fn topSize(p: *Pardes, f: TopFile) u64 {
return switch (f) {
- // ponytail: /screen has no length until an open renders its frame,
- // and /pane/new none until an open has a pane to name.
- .root, .pane, .col, .screen, .new => 0,
- .layout => cols.layoutLen(p),
+ // Views generated whole by each read have no length, as acme's
+ // generated files have none: /screen until an open renders its
+ // frame, /pane/new until an open has a pane to name, and the index,
+ // layout, recent list and listeners, which a stat would otherwise
+ // have to build to count.
+ .root, .pane, .col, .screen, .new, .layout, .index, .recent, .listeners => 0,
.tag => cols.headerText(p, null).?.len,
- .index => pane.indexLen(p),
.README => fs.help.len,
.status => ctl.statusLen(p),
.look, .exec, .tagexec => ctl.resultsLen(p),
.log => events.logLen(&p.fs.log),
- .listeners => listeners: {
- var buf: [screen.listeners_cap]u8 = undefined;
- break :listeners screen.listenersText(p, &buf).len;
- },
.ctl => ctl.rootLen(p),
.commands => ctl.commandsLen(),
- .recent => recentLen(p),
.focus => focus: {
if (p.header_focus) break :focus 0;
const pn = p.panes[p.active] orelse break :focus 0;