summaryrefslogtreecommitdiff
path: root/src/rollback.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-09 03:29:30 -0300
committerGabriel Schneider <[email protected]>2026-11-09 03:30:49 -0300
commit84c8209d02f6830db861c3a8dde0c710c88075f0 (patch)
tree10f77e3ab1becb5a0af4de152bb8d8e0e9ee0f03 /src/rollback.zig
parent446292e15d56c9c248dae5d6fde1be3a83ade82e (diff)
downloadpardes-84c8209d02f6830db861c3a8dde0c710c88075f0.tar.gz
pardes-84c8209d02f6830db861c3a8dde0c710c88075f0.zip
idioms: the edit surface fails by name: the undo history (Journal.mark, Text.remember and step, File's, terminal's and edit's pushUndo and undoStep) returns error{OutOfMemory} instead of dropping an undo point, setEditText, enterInsert and insertTab return edit.Error with try where they reported each failure, Registers.put and setYank return error{OutOfMemory} instead of losing a yank, and their other-file callers decide (try under edit.Error, said on the pane by Undo, Redo, Pipe, Edit, Query, keys, look, completion, Incl and Plumb, ENOMEM or null where a 9P write answers, Ask's false); ctl.get and getFile return GetError (fs.ReadError, now named at fs.zig's surface, and InvalidName) for the *anyerror out-parameter and errno, the 9P get, Get and Edit's e mapping it as before; the OOM undo test pins the error; perf.zig's try relabels its harness hash, the three baselines re-keyed to it (their numbers the base's)
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/rollback.zig')
-rw-r--r--src/rollback.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rollback.zig b/src/rollback.zig
index e08e6242..ccd056fd 100644
--- a/src/rollback.zig
+++ b/src/rollback.zig
@@ -718,7 +718,7 @@ test "a register's texts are pinned, not copied, and come back whole" {
defer std.testing.allocator.free(grid);
@memset(grid, 'y');
const reg = pardes.Registers.default;
- p.registers.put(gpa, reg, grid, 0, 1, true);
+ try p.registers.put(gpa, reg, grid, 0, 1, true);
_ = p.registers.text(gpa, reg) orelse return error.NoText;
var c: Copy = .{};
defer c.deinit();
@@ -726,7 +726,7 @@ test "a register's texts are pinned, not copied, and come back whole" {
try std.testing.expect(c.savedBytes() < 1 << 20);
try std.testing.expect(c.pinnedBytes() >= 4 << 20);
// A speculation yanks over it, and is undone.
- p.registers.put(gpa, reg, "a word", 0, 1, true);
+ try p.registers.put(gpa, reg, "a word", 0, 1, true);
try std.testing.expect(c.restore());
const back = p.registers.value(reg, 0) orelse return error.Lost;
try std.testing.expectEqual(grid.len, back.len);