summaryrefslogtreecommitdiff
path: root/src/Effect.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/Effect.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/Effect.zig')
-rw-r--r--src/Effect.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Effect.zig b/src/Effect.zig
index 487fda82..4dfa72e1 100644
--- a/src/Effect.zig
+++ b/src/Effect.zig
@@ -164,7 +164,7 @@ pub fn perform(p: *Pardes, e: Effect) void {
return;
}
if (!pane.isTerminal()) return;
- const text = panes.terminal.screenTextAlloc(pane, p.gpa) catch return;
+ const text = panes.terminal.screenTextAlloc(pane, p.gpa) catch |err| return p.reportError(st.pane, "Save", err);
defer p.gpa.free(text);
if (writeChecked(p, st.pane, st.serial, st.path.slice(), text, 0)) |still|
ctlfs.events.noteLogAs(p, .save, still, st.path.slice());
@@ -276,7 +276,7 @@ pub fn writeChecked(p: *Pardes, id: u8, serial: u32, path: []const u8, bytes: []
fn promoteSaved(p: *Pardes, id: u8, path: []const u8) void {
const pane = p.panes[id] orelse return;
const f = if (pane.file) |*file| file else return;
- const owned = p.gpa.dupe(u8, path) catch return;
+ const owned = p.gpa.dupe(u8, path) catch |err| return p.reportError(id, "Save", err);
p.gpa.free(f.path);
f.path = owned;
f.output = null;