From 5de9d27458cd8ff7e326532e8923c933e141ea7f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 9 Nov 2026 03:31:33 -0300 Subject: idioms: swallows a caller can decide on, decided: a key a macro or a repeat cannot keep is said (Macro.append returns error{OutOfMemory}), a kind's found rows and list pane say their copy's failure as their fill's, a kind word's value past its pane's 256-byte record is said instead of dropped, and the REPL ask record's two prints, which fit, are unreachable with the reason Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/keys.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/keys.zig') diff --git a/src/keys.zig b/src/keys.zig index 5be3a110..c197940e 100644 --- a/src/keys.zig +++ b/src/keys.zig @@ -153,7 +153,7 @@ pub fn answerQuestion(p: *Pardes, id: usize, choice: ?u8) bool { pub fn handleKey(p: *Pardes, key: Key) void { // A double-click is two clicks with nothing between them. p.view().last_click = null; - if (p.macro.recording != 0 and p.macro.replaying == 0) Macro.append(&p.macro.recorded, p.gpa, key); + if (p.macro.recording != 0 and p.macro.replaying == 0) Macro.append(&p.macro.recorded, p.gpa, key) catch |err| p.reportError(p.view().active, "macro", err); // A question waiting on a pane takes the next key, whatever mode the // pane or a header edit is in: that key is its answer. for (p.panes, 0..) |slot, id| { @@ -414,7 +414,7 @@ pub fn handleKey(p: *Pardes, key: Key) void { const m = &p.macro; switch (was) { .normal => { - Macro.append(&m.command, p.gpa, key); + Macro.append(&m.command, p.gpa, key) catch |err| p.reportError(p.view().active, "macro", err); if (t.mode == .insert) { m.last_insert.clearRetainingCapacity(); m.last_insert.appendSlice(p.gpa, m.command.items) catch |err| p.reportError(p.view().active, "macro", err); @@ -424,7 +424,7 @@ pub fn handleKey(p: *Pardes, key: Key) void { } else if (std.meta.eql(t.normal, modal.Normal.State{})) m.command.clearRetainingCapacity(); }, .insert => if (m.inserting) { - Macro.append(&m.last_insert, p.gpa, key); + Macro.append(&m.last_insert, p.gpa, key) catch |err| p.reportError(p.view().active, "macro", err); if (t.mode != .insert) m.inserting = false; }, .tty => {}, -- cgit v1.3