From 71a9f04342493325c10b1b9bc122a88d41143782 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 27 Sep 2026 22:46:26 -0300 Subject: Give the pipe its own fields in Pipe Not a pure move: state moves. Pardes's `pipe_seq` and `pipe_wait` become Pipe.zig's own fields `seq` and `wait`, and Pardes embeds one as `pipe: Pipe = .{}`. pipeRequest reads only the request in flight, so it now takes `pipe: *const Pipe` and the four shells call `core.pipe.pipeRequest(id)` (their Pipe imports go away again); the other pipe functions still need the panes and keep `p: *Pardes`, writing `p.pipe.seq/wait`. Field reads in dump.zig, the shells' tests and two test files follow (`core.pipe_wait` becomes `core.pipe.wait`). No behaviour change. Co-Authored-By: Claude Opus 5.5 --- src/detached/server.zig | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/detached/server.zig') diff --git a/src/detached/server.zig b/src/detached/server.zig index 9b23f8d6..2b9c9247 100644 --- a/src/detached/server.zig +++ b/src/detached/server.zig @@ -9,7 +9,6 @@ const wire = @import("wire.zig"); const host_io = @import("../host_io.zig"); const selection_pipe = @import("../selection_pipe.zig"); -const Pipe = @import("../Pipe.zig"); const file_watch = @import("../file_watch.zig"); @@ -412,7 +411,7 @@ pub const Session = struct { s.core.update(.{ .pipe_resp = .{ .id = id, .success = false, .outputs = &.{} } }); return; } - const request = Pipe.pipeRequest(s.core, id) orelse return; + const request = s.core.pipe.pipeRequest(id) orelse return; const job = selection_pipe.Job.copy(s.worker_gpa, request) catch |err| { s.core.update(.{ .pipe_resp = .{ .id = id, .success = false, .outputs = &.{} } }); return s.core.reportError(s.core.active, "pipe", err); @@ -1257,9 +1256,9 @@ test "detached worker setup failure completes requests without changing document s.core.update(.{ .key = .{ .cp = '|' } }); s.core.update(.{ .key = .{ .cp = 't', .text = "tr a-z A-Z" } }); s.core.update(.{ .key = .{ .cp = pardes.Key.enter } }); - try std.testing.expect(s.core.pipe_wait != null); + try std.testing.expect(s.core.pipe.wait != null); while (s.core.nextEffect()) |effect| s.core.perform(effect); - try std.testing.expect(s.core.pipe_wait == null); + try std.testing.expect(s.core.pipe.wait == null); try std.testing.expectEqual(@as(usize, 0), s.pipe_tasks.len); try std.testing.expectEqualStrings("one\n", pane.file.?.content); try std.testing.expect(failing.has_induced_failure); -- cgit v1.3