From d126715cd20a39dbc10870318968546f5e371b97 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 27 Sep 2026 22:42:54 -0300 Subject: Split the pipe's editor side out of selection_pipe.zig into Pipe.zig Pure move, no behaviour change: the editor half of `|` that the earlier change put at the end of selection_pipe.zig (PendingPipe, pipeMarker, submitPipe, pipeRequest, pipeFailed, pipeCut, pipeOutput, pipeResponse, and the eight pipe tests with nextPipeEffect) now lives in its own Pipe.zig, so the pipe's editor state can become Pipe's own fields next. selection_pipe.zig goes back to exactly what it was before this series: the native runner and the boundary values the shells hand to their workers. The moved code names the runner's types as `selection_pipe.X` again, as it did in pardes.zig; callers change from `selection_pipe.submitPipe(p, ..)` to `Pipe.submitPipe(p, ..)` (pardes.zig and the four shells). Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index d2ac5868..00439a36 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -17,6 +17,7 @@ pub const normal = @import("normal.zig"); pub const edit = @import("edit.zig"); pub const body_layer = @import("body_layer.zig"); pub const Messages = @import("Messages.zig"); +pub const Pipe = @import("Pipe.zig"); pub const colors = @import("colors.zig"); pub const Theme = colors.Theme; pub const themes = colors.themes; @@ -443,6 +444,7 @@ test { _ = @import("edit.zig"); _ = @import("Messages.zig"); _ = @import("selection_pipe.zig"); + _ = @import("Pipe.zig"); _ = @import("colors.zig"); _ = @import("surface.zig"); _ = @import("body_layer.zig"); @@ -3745,7 +3747,7 @@ pub const Pardes = struct { } = null, pipe_seq: u32 = 0, - pipe_wait: ?selection_pipe.PendingPipe = null, + pipe_wait: ?Pipe.PendingPipe = null, fs: filesystem.Namespace = .{}, boot: Boot = .shell, @@ -4688,7 +4690,7 @@ pub const Pardes = struct { p.reportError(e.pane, "terminal exited; Del retries close", err); }, .lsp_resp => |r| p.lspResponse(r.id, r.rows), - .pipe_resp => |r| selection_pipe.pipeResponse(p, r.id, r.success, r.outputs, r.failure), + .pipe_resp => |r| Pipe.pipeResponse(p, r.id, r.success, r.outputs, r.failure), .file_changed => |fc| _ = p.applyWatchedFileChanged(fc.pane, fc.bytes), .key => |key| { p.can_ask = true; @@ -5386,7 +5388,7 @@ pub const Pardes = struct { const submit = hit(key, config.search_submit); switch (pane.prompt) { .pipe => |pipe| { - if (submit) selection_pipe.submitPipe(p, p.active); + if (submit) Pipe.submitPipe(p, p.active); pane.tag_tail_len = @min(pipe.at, pane.tag_tail_len); }, .save => |at| { @@ -5501,7 +5503,7 @@ pub const Pardes = struct { .pipe => |how| pipe: { const file = pane.file orelse return; if (!panes.Output.fileTraits(file.output).saves) return; - break :pipe selection_pipe.pipeMarker(how); + break :pipe Pipe.pipeMarker(how); }, }; p.seedTail(pane); -- cgit v1.3