summaryrefslogtreecommitdiff
path: root/src/edit.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 14:39:47 -0300
committerGabriel Schneider <[email protected]>2026-11-06 14:56:36 -0300
commite8e7ed956f3914a3790e980df0862b26c30bd611 (patch)
tree53d3247c594717f79745ad20c5dd23bf16ed59ea /src/edit.zig
parenta821fe82d8de3d407ebe104358b97719bd983727 (diff)
downloadpardes-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/edit.zig')
-rw-r--r--src/edit.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/edit.zig b/src/edit.zig
index 4253d293..064f0f44 100644
--- a/src/edit.zig
+++ b/src/edit.zig
@@ -118,8 +118,8 @@ pub fn applyPaste(p: *Pardes, whole: []const u8) Error!void {
const limit = @import("memory.zig").limits.max_paste_bytes;
const bytes = if (whole.len > limit) whole[0..modal.graphemeStart(whole, limit)] else whole;
if (whole.len > limit) {
- var said: [96]u8 = undefined;
- p.setMessage(v.active, std.fmt.bufPrint(&said, "paste cut at its limit, {d} KiB: the rest left out", .{limit / 1024}) catch unreachable); // a usize and 47 bytes fit 96
+ var said: pardes.Kind.Buf(96) = .{};
+ p.setMessage(v.active, said.print("paste cut at its limit, {d} KiB: the rest left out", .{limit / 1024}));
}
// A prompt answering for a header takes the paste, as it takes keys.
const asking = if (p.panes[v.active]) |active| active.prompt != .none else false;