From e0aadf23d5ff5759fd53267dbafa8e278a324107 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 00:58:36 -0300 Subject: The tree's README and fs.md answer round 8's doc questions The README's log line names newcol, delcol, ask, restored and restoredcol; it says what $m is under 9ns --unix; and a build that embeds no sources no longer lists src/ (derived from the build, and tested). fs.md says what the rest of a typed line does after Kill for each shell (fish runs on, bash abandons it), that Exec in a .py pane runs a command and never the REPL, and why appending to a tag wants printf and a leading blank. Co-Authored-By: Claude Opus 5.5 --- src/fs.zig | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/fs.zig') diff --git a/src/fs.zig b/src/fs.zig index 65e5d276..8be728a6 100644 --- a/src/fs.zig +++ b/src/fs.zig @@ -19,7 +19,14 @@ const Reply = tree.Reply; const E = tree.E; /// The served README; tree.zig answers it. -pub const help = @embedFile("fs-help.txt"); +/// The tree's README; a build that embeds no sources lists no src/. +pub const help = help: { + const raw = @embedFile("fs-help.txt"); + if (limits.embedded_sources) break :help raw; + const both = "os/, src/ the host filesystem; the editor's own sources"; + const at = std.mem.indexOf(u8, raw, both) orelse @compileError("fs-help.txt no longer lists os/, src/"); + break :help raw[0..at] ++ "os/ the host filesystem" ++ raw[at + both.len ..]; +}; /// Host filesystem nodes: the root, and one hashed node per path a client walked to. pub const os_root: u64 = (1 << 63) + 2; @@ -1364,3 +1371,7 @@ pub fn unmount(p: *Pardes, name: []const u8) !void { test { _ = tree; } + +test "the tree's README lists src/ only when the build serves it" { + try std.testing.expectEqual(limits.embedded_sources, std.mem.indexOf(u8, help, "src/") != null); +} -- cgit v1.3