From 34a80c9f9b81b64d095a1d5123ae74a52bef4749 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 12:42:32 -0300 Subject: 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 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/colors.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/colors.zig') diff --git a/src/colors.zig b/src/colors.zig index 7bac64ea..bf68c256 100644 --- a/src/colors.zig +++ b/src/colors.zig @@ -676,7 +676,7 @@ fn themeFileFailure(p: *Pardes, request: ThemeFileRequest, why: []const u8) void var said: [520]u8 = undefined; var cut: [200]u8 = undefined; const path = @import("ninep/tree.zig").fitErr(request.path, &cut); - p.reportFailure(request.pane, std.fmt.bufPrint(&said, "theme file {s}: {s}", .{ path, why }) catch "theme file: not loaded"); + p.reportFailure(request.pane, std.fmt.bufPrint(&said, "theme file {s}: {s}", .{ path, why }) catch unreachable); // two 200-byte parts fit 520 revertThemeFile(p); } @@ -778,7 +778,7 @@ pub fn themesNear(buf: []u8, name: []const u8) []const u8 { fn putName(w: *std.Io.Writer, cap: usize, name: []const u8) bool { const sep: []const u8 = if (w.buffered().len > 0) " " else ""; if (w.buffered().len + sep.len + name.len > cap) return false; - w.print("{s}{s}", .{ sep, name }) catch return false; + w.print("{s}{s}", .{ sep, name }) catch unreachable; // fits: checked above return true; } -- cgit v1.3