summaryrefslogtreecommitdiff
path: root/src/Pipe.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 05:49:29 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit2b04f877c29cf1e95c2fc8154de1da322c7299a3 (patch)
tree1430ca4deb53e0fae0b24238af543a13cf2125e1 /src/Pipe.zig
parent779ff8cc27014b8c2f2f078985ab2ca9cf285740 (diff)
downloadpardes-2b04f877c29cf1e95c2fc8154de1da322c7299a3.tar.gz
pardes-2b04f877c29cf1e95c2fc8154de1da322c7299a3.zip
edit: the routing of a text's characters takes the editing context (docs/next-editor.md, R2, first slice): flatSurface, editText, editTextEol, setEditText, setEditTextEnd, setEditTextSpan, paneCursorLines, paneByteAtDisplay, pinPaneCursor, paneWrapWidth, treeIndent, pushUndo, undoStep, stepOwn, selText and vselText take `e: Editor` where they took `*Pardes`, the pane they route to reached through `e.p`; 149 calls in 16 files hand `p.editor()`, nothing else changes; 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/Pipe.zig')
-rw-r--r--src/Pipe.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Pipe.zig b/src/Pipe.zig
index 10967a3c..9b913f1e 100644
--- a/src/Pipe.zig
+++ b/src/Pipe.zig
@@ -95,7 +95,7 @@ pub fn submitPipe(p: *Pardes, id: usize) void {
const f = pane.file orelse return;
if (!panes.Output.fileTraits(f.output).saves) return;
}
- const content = edit.flatSurface(p, t) catch |err| return p.reportError(id, "pipe", err);
+ const content = edit.flatSurface(p.editor(), t) catch |err| return p.reportError(id, "pipe", err);
const how = switch (pane.prompt) {
.pipe => |pipe| pipe,
else => return,
@@ -259,7 +259,7 @@ pub fn pipeResponse(
.workspace => &p.global_tag,
.input => return,
};
- const content = edit.flatSurface(p, t) catch |err| return p.reportError(wait.pane, "pipe", err);
+ const content = edit.flatSurface(p.editor(), t) catch |err| return p.reportError(wait.pane, "pipe", err);
const changed = if (t.what == .body) changed: {
const f = pane.file orelse return;
if (!panes.Output.fileTraits(f.output).saves) return;
@@ -314,12 +314,12 @@ pub fn pipeResponse(
}
// One async request is one history transaction, even at 64 cursors.
- edit.pushUndo(p, t) catch |err| {
+ edit.pushUndo(p.editor(), t) catch |err| {
p.gpa.free(replacement);
return p.reportError(wait.pane, "pipe", err);
};
- edit.setEditText(p, t, replacement) catch |err| return p.reportError(wait.pane, "pipe", err);
- const now = edit.flatSurface(p, t) catch |err| return p.reportError(wait.pane, "pipe", err);
+ edit.setEditText(p.editor(), t, replacement) catch |err| return p.reportError(wait.pane, "pipe", err);
+ const now = edit.flatSurface(p.editor(), t) catch |err| return p.reportError(wait.pane, "pipe", err);
t.setRanges(now, new_ranges[0..n], &.{}, wait.primary, wait.explicit);
t.select = false;
t.show();