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/Query.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Query.zig') diff --git a/src/Query.zig b/src/Query.zig index 4cede3c5..0263052d 100644 --- a/src/Query.zig +++ b/src/Query.zig @@ -336,14 +336,14 @@ pub fn toLineOne(p: *Pardes, id: usize) void { if (layout.findPane(p, id)) |at| p.setActiveColumn(at.col); rp.focus = .body; const t = &rp.body; - if (t.mode == .insert) edit.exitInsert(p, t); + if (t.mode == .insert) edit.exitInsert(p.editor(), t); t.cur_row = 0; t.cur_col = @intCast(lineOne(rp.file.?.content).len); t.vsel.active = false; t.nsel = 0; t.cur_pinned = true; rp.query.?.seen_row = 0; - edit.enterInsert(p, t, .line_end, 1) catch |err| return p.reportError(id, "query", err); + edit.enterInsert(p.editor(), t, .line_end, 1) catch |err| return p.reportError(id, "query", err); showCurrent(rp); } @@ -1318,7 +1318,7 @@ pub fn fillList(p: *Pardes, owner_id: usize, source: Source, rows: []const u8) v if (layout.findPane(p, qid)) |at| p.setActiveColumn(at.col); rp.focus = .body; const t = &rp.body; - if (t.mode == .insert) edit.exitInsert(p, t); + if (t.mode == .insert) edit.exitInsert(p.editor(), t); t.vsel.active = false; t.nsel = 0; caretTo(rp, q.current orelse 0); @@ -1770,7 +1770,7 @@ pub fn land(p: *Pardes, id: usize, row: ?usize) void { const q = rp.query orelse return; if (row) |r| if (r < q.items.items.len and q.items.items[r].kind == .hit) setCurrent(p, id, r, true); const t = &rp.body; - if (t.mode == .insert) edit.exitInsert(p, t); + if (t.mode == .insert) edit.exitInsert(p.editor(), t); freeze(p, id); const owner_id = p.paneBySerial(q.owner); if (q.source == .text) { @@ -1872,7 +1872,7 @@ pub fn cancel(p: *Pardes, id: usize) void { const rp = p.panes[id] orelse return; const q = rp.query orelse return; const t = &rp.body; - if (t.mode == .insert) edit.exitInsert(p, t); + if (t.mode == .insert) edit.exitInsert(p.editor(), t); const owner_id = p.paneBySerial(q.owner); for (p.panes) |slot| if (slot) |tp| { if (tp.places.from != rp.serial and tp.serial != q.owner) continue; -- cgit v1.3