From 9b60771ffcd254772b716fafe488b09d9c2d3e0c Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 12:15:23 -0300 Subject: idioms #16, edits fail by name: the edit operations return edit.Error (memory, or a terminal's rows not read) and try where they caught and returned, so the key, chord or paste that ran one says the failure (`edit: out of memory`, reportError) where it did nothing; look, Core, File and terminal say theirs the same way, and the prints whose buffer provably fits catch unreachable with why Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/Effect.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Effect.zig') diff --git a/src/Effect.zig b/src/Effect.zig index 2bcf82f5..487fda82 100644 --- a/src/Effect.zig +++ b/src/Effect.zig @@ -347,7 +347,7 @@ test "Save on a scratch asks for a path in its inherited dir and makes it a file try std.testing.expectEqualStrings(" Save /tmp/pardes-save-dir/", np.promptText().?); // typing the filename and submitting converts it into an ordinary file - edit.insertKey(p, &np.input, .{ .cp = 'n', .text = "note.txt" }); + try edit.insertKey(p, &np.input, .{ .cp = 'n', .text = "note.txt" }); exec.submitSave(p, id); // The write asked for, the pane is the file once it is done. var saved = false; @@ -372,7 +372,7 @@ test "Save on a terminal writes its plaintext scrollback and stays a terminal" { try std.testing.expect(p.executeBuiltinLine(0, "Save")); try std.testing.expect(pane.prompt == .save); - edit.insertKey(p, &pane.input, .{ .cp = 'l', .text = "log.txt" }); + try edit.insertKey(p, &pane.input, .{ .cp = 'l', .text = "log.txt" }); exec.submitSave(p, 0); // the pane is untouched: still a terminal, no file behind it @@ -421,7 +421,7 @@ test "Save on an output buffer writes its rows out and leaves the buffer alone" try std.testing.expectEqualStrings(tagline.file_pane_tail, tagline.curTail(out)); try std.testing.expect(p.executeBuiltinLine(id, "Save")); try std.testing.expect(out.prompt == .save); - edit.insertKey(p, &out.input, .{ .cp = 'h', .text = "help.txt" }); + try edit.insertKey(p, &out.input, .{ .cp = 'h', .text = "help.txt" }); exec.submitSave(p, id); // the buffer itself is untouched: same origin, same name, still refillable -- cgit v1.3