summaryrefslogtreecommitdiff
path: root/src/modal.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 12:42:32 -0300
committerGabriel Schneider <[email protected]>2026-11-06 14:56:36 -0300
commit34a80c9f9b81b64d095a1d5123ae74a52bef4749 (patch)
tree618eb5f3d1bd04e659ba6389977d017aff4f4033 /src/modal.zig
parent9b60771ffcd254772b716fafe488b09d9c2d3e0c (diff)
downloadpardes-34a80c9f9b81b64d095a1d5123ae74a52bef4749.tar.gz
pardes-34a80c9f9b81b64d095a1d5123ae74a52bef4749.zip
idioms #17, the rest of the core says its failures: tagline, keys, panes, Effect and the header text in mouse report a failed allocation or shell where they returned with nothing said, the headers' own text (flatSurface makes none) and the prints whose buffer provably fits (layout, modal, panes, keys, colors) catch unreachable with why
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/modal.zig')
-rw-r--r--src/modal.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modal.zig b/src/modal.zig
index c510adc1..a6781af3 100644
--- a/src/modal.zig
+++ b/src/modal.zig
@@ -1459,7 +1459,7 @@ pub fn incrementDecimal(alloc: std.mem.Allocator, frag: []const u8, amount: i64)
if (!neg and neg_after) flen += 1;
var buf: [48]u8 = undefined;
// "{d}" prints '+' for positive signed ints — format the magnitude unsigned
- const mag = std.fmt.bufPrint(&buf, "{d}", .{@abs(nv)}) catch return null;
+ const mag = std.fmt.bufPrint(&buf, "{d}", .{@abs(nv)}) catch unreachable; // a u128 is 39 digits
const sign_len: usize = @intFromBool(neg_after);
const want = if (pad) flen - sign_len else mag.len;
const digits_len = @max(want, mag.len);