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/panes.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/panes.zig') diff --git a/src/panes.zig b/src/panes.zig index 1ec78bbc..ffaaba37 100644 --- a/src/panes.zig +++ b/src/panes.zig @@ -893,7 +893,7 @@ pub fn newScratchBelow(p: *Pardes, from_id: usize) void { /// A scratch for New (`.scratch`) or 9P's pane/new (`.fs`). pub fn newScratchFor(p: *Pardes, from_id: usize, kind: exec.NewPane) void { const free = p.freeSlot() orelse return p.reportError(from_id, "New", error.NoPaneSlots); - _ = newScratch(p, from_id, free, kind) catch return; + _ = newScratch(p, from_id, free, kind) catch |err| return p.reportError(from_id, "New", err); exec.placeNew(p, from_id, from_id, free, kind); } @@ -1052,7 +1052,7 @@ pub fn startPrompt(p: *Pardes, pane: *Pane, t: *Text, request: union(enum) { if (request == .save and p.fs.serving) { if (pane.prompt == .save) return; var rec: [32]u8 = undefined; - ctlfs.events.notePath(p, "ask", std.fmt.bufPrint(&rec, "{d} save path", .{pane.serial}) catch ""); + ctlfs.events.notePath(p, "ask", std.fmt.bufPrint(&rec, "{d} save path", .{pane.serial}) catch unreachable); // a u32 } const marker = switch (request) { .search => |marker| marker, @@ -1071,7 +1071,7 @@ pub fn startPrompt(p: *Pardes, pane: *Pane, t: *Text, request: union(enum) { // directory for the name to be typed onto. const dir = if (request == .save) paneDir(pane) else ""; const slash: []const u8 = if (request == .save and (dir.len == 0 or dir[dir.len - 1] != '/')) "/" else ""; - const answer = std.mem.concat(p.gpa, u8, &.{ marker, dir, slash }) catch return; + const answer = std.mem.concat(p.gpa, u8, &.{ marker, dir, slash }) catch |err| return p.reportError(p.view().active, "prompt", err); // The keyboard comes back to the text answered for; a prompt for // the body takes it out of a tag or header. switch (t.what) { -- cgit v1.3