diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-06 14:39:47 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-06 14:56:36 -0300 |
| commit | e8e7ed956f3914a3790e980df0862b26c30bd611 (patch) | |
| tree | 53d3247c594717f79745ad20c5dd23bf16ed59ea /src/keys.zig | |
| parent | a821fe82d8de3d407ebe104358b97719bd983727 (diff) | |
| download | pardes-e8e7ed956f3914a3790e980df0862b26c30bd611.tar.gz pardes-e8e7ed956f3914a3790e980df0862b26c30bd611.zip | |
idioms #20, the bound in the type or the cut handled: of the 166 `catch unreachable` the pass kept, 64 stay where a reader checks the bound without arithmetic (an integer's digits, a declared field's size, and now the daemon's pid lists and the clock's two-digit fields written in their types), 69 texts print through Kind.Buf at their old size, 31 handle the failure once (a print into ename cut at its 320, paneText's line cut where its buffer fills, a log record or mouse report dropped rather than cut short, the question's letters that fit), Newcol's and pane/new's refusals are comptime strings, and dropUnsaved's too-long scratch name is null, not an empty sentinel
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/keys.zig')
| -rw-r--r-- | src/keys.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/keys.zig b/src/keys.zig index 5ebdc046..33760b8b 100644 --- a/src/keys.zig +++ b/src/keys.zig @@ -90,8 +90,8 @@ pub fn questionChoices(p: *const Pardes, id: usize, buf: []u8) ?[]const u8 { const ask = p.repl_ask orelse return null; var w = std.Io.Writer.fixed(buf); for (ask.offered, 0..) |serial, i| if (serial != 0) { - if (w.buffered().len > 0) w.writeByte(' ') catch unreachable; // 26 letters and spaces fit 64 - w.writeByte(@intCast('a' + i)) catch unreachable; // [26]u32 offered: 51 bytes fit 64 + if (w.buffered().len > 0) w.writeByte(' ') catch break; // the letters that fit + w.writeByte(@intCast('a' + i)) catch break; // the letters that fit }; return w.buffered(); }, |
