From 3dd2072fc525cdadf4f55a69f745c73c0b8c2b21 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 05:53:16 -0300 Subject: edit: the edits of a text take the editing context (docs/next-editor.md, R2, second slice): enterInsert, exitInsert, handleInsert, insertKey, insertEdit, insertTab, pasteRegister, pasteText, normalDelete, normalYank, normalChange, deleteSelection, setEditCells, normalReplaceChar, chordReplace, replaceWithText, normalCase, normalJoin, normalRotateContents, normalAlign, normalIndent, normalToggleComment, normalAdjustNumber, addNewline, textobjectSelect and the three surrounds take `e: Editor`; insertEdit's splice end is `stop` and a comment extension `x` where they were `e`; 71 calls in 8 files hand `p.editor()`; core-test 810 of 949, shell-test 989 of 992, hxdiff 658 / parity 738 / hxgolf 124 with 0 mismatches, replicas pass --- 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 08694e93..344034e2 100644 --- a/src/Effect.zig +++ b/src/Effect.zig @@ -364,7 +364,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 - try edit.insertKey(p, &np.input, .{ .cp = 'n', .text = "note.txt" }); + try edit.insertKey(p.editor(), &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; @@ -390,7 +390,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); - try edit.insertKey(p, &pane.input, .{ .cp = 'l', .text = "log.txt" }); + try edit.insertKey(p.editor(), &pane.input, .{ .cp = 'l', .text = "log.txt" }); exec.submitSave(p, 0); // the pane is untouched: still a terminal, no file behind it @@ -440,7 +440,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); - try edit.insertKey(p, &out.input, .{ .cp = 'h', .text = "help.txt" }); + try edit.insertKey(p.editor(), &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