summaryrefslogtreecommitdiff
path: root/src/Query.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 05:53:16 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit3dd2072fc525cdadf4f55a69f745c73c0b8c2b21 (patch)
treebbde59afec92eab134c9d8db248ff9369530d952 /src/Query.zig
parent2b04f877c29cf1e95c2fc8154de1da322c7299a3 (diff)
downloadpardes-3dd2072fc525cdadf4f55a69f745c73c0b8c2b21.tar.gz
pardes-3dd2072fc525cdadf4f55a69f745c73c0b8c2b21.zip
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
Diffstat (limited to 'src/Query.zig')
-rw-r--r--src/Query.zig10
1 files changed, 5 insertions, 5 deletions
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;