summaryrefslogtreecommitdiff
path: root/src/detached/server.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-27 22:46:26 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit71a9f04342493325c10b1b9bc122a88d41143782 (patch)
treec9b1f27a84404a8332c4066a56d922a031eec194 /src/detached/server.zig
parentd126715cd20a39dbc10870318968546f5e371b97 (diff)
downloadpardes-71a9f04342493325c10b1b9bc122a88d41143782.tar.gz
pardes-71a9f04342493325c10b1b9bc122a88d41143782.zip
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 <[email protected]>
Diffstat (limited to 'src/detached/server.zig')
-rw-r--r--src/detached/server.zig7
1 files changed, 3 insertions, 4 deletions
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);