summaryrefslogtreecommitdiff
path: root/src/host/state_files.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 01:53:25 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commitf3591d48a16086dd4b3b081da00804d2541fefcc (patch)
treeab0b0e5dcb0b2d43d838b5cd28027b4d003858f4 /src/host/state_files.zig
parent3e5ad32c529c4c566989ef8201159100a4a3e32c (diff)
downloadsketchbook-f3591d48a16086dd4b3b081da00804d2541fefcc.tar.gz
sketchbook-f3591d48a16086dd4b3b081da00804d2541fefcc.zip
The tree describes itself: README and commands from the tables; ctl takes input live
README is made at each open from the tables (pinned per open, as the traces are): a line a file from control.zig's `files`, ctl's verbs indented under ctl (ctl's own, the script's input verbs, the console's, each with its args and doc from its row), and a line per State file under state/, from the layout (its path with <n> for an index, its type, an enum's tags, a row's length), in the shape cloud9's `help` reads: `help ctl` prints the verbs, `help state/tracker` the state/ line and every file under it. `commands` is the verb lines alone, unindented, the sketch's own words (App.commands) last. A ctl read points at both. ctl takes the script's input verbs live: click, move, down, up, wheel, wheel-x, cancel, key, hold, release, type route their events at the wall clock through script.input, the same code a script runs, with no frame of their own: the next frame feeds them to update. Order: ctl's own words, then the input verbs, then a console line (and through it the sketch's); so a sketch command named like an input verb is shadowed over ctl (none is today). Tests: test-control, a new test: ctl's click and hold reach the pending events, a short click is refused (ExpectedPoint), README and commands read the rows and the layout: 40/40 steps, 10/10 tests. Live with the replay fixture: README read over 9P, `down 5 5` written to ctl moved state/pressing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/host/state_files.zig')
-rw-r--r--src/host/state_files.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/host/state_files.zig b/src/host/state_files.zig
index 016b9fe..ed796c9 100644
--- a/src/host/state_files.zig
+++ b/src/host/state_files.zig
@@ -207,7 +207,7 @@ pub fn readme(layout: Layout, w: *std.Io.Writer) std.Io.Writer.Error!void {
}
const row = std.mem.endsWith(u8, leaf.path, "[]");
try w.print("{s}", .{lw.buffered()});
- try w.splatByteAll(' ', 40 -| lw.buffered().len + 1);
+ try w.splatByteAll(' ', @max(1, 41 -| lw.buffered().len));
if (row) try w.print("{d} ", .{leaf.dims[leaf.dims.len - 1].count});
switch (leaf.kind) {
.int, .uint, .float => try w.print("{s}{d}", .{ switch (leaf.kind) {