diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-06 12:42:32 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-06 14:56:36 -0300 |
| commit | 34a80c9f9b81b64d095a1d5123ae74a52bef4749 (patch) | |
| tree | 618eb5f3d1bd04e659ba6389977d017aff4f4033 /src/panes.zig | |
| parent | 9b60771ffcd254772b716fafe488b09d9c2d3e0c (diff) | |
| download | pardes-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/panes.zig')
| -rw-r--r-- | src/panes.zig | 6 |
1 files changed, 3 insertions, 3 deletions
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) { |
