summaryrefslogtreecommitdiff
path: root/src/tty/tty.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/tty/tty.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/tty/tty.zig')
-rw-r--r--src/tty/tty.zig7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/tty/tty.zig b/src/tty/tty.zig
index 24403ba8..e3378f5b 100644
--- a/src/tty/tty.zig
+++ b/src/tty/tty.zig
@@ -11,7 +11,6 @@ const look = @import("../look.zig");
const message = pardes.Messages.Message;
const file_watch = @import("../file_watch.zig");
const selection_pipe = @import("../selection_pipe.zig");
-const Pipe = @import("../Pipe.zig");
const ninep_io = @import("../9p_io.zig");
const panel_compositor = @import("panel_compositor.zig");
const detached_client = @import("../detached/client.zig");
@@ -1326,7 +1325,7 @@ const Shell = struct {
s.core.update(.{ .pipe_resp = .{ .id = id, .success = false, .outputs = &.{} } });
return;
}
- const view = Pipe.pipeRequest(s.core, id) orelse return;
+ const view = s.core.pipe.pipeRequest(id) orelse return;
const job = selection_pipe.Job.copy(s.gpa, view) catch |err| {
s.core.update(.{ .pipe_resp = .{ .id = id, .success = false, .outputs = &.{} } });
return s.core.reportError(s.core.active, "pipe", err);
@@ -1424,9 +1423,9 @@ test "TTY worker setup failures finish matching LSP and pipe requests" {
core.update(.{ .key = .{ .cp = '|' } });
core.update(.{ .key = .{ .cp = 't', .text = "tr a-z A-Z" } });
core.update(.{ .key = .{ .cp = pardes.Key.enter } });
- const pipe_id = core.pipe_wait.?.id;
+ const pipe_id = core.pipe.wait.?.id;
Shell.pipe(&shell, pipe_id);
- try std.testing.expect(core.pipe_wait == null);
+ try std.testing.expect(core.pipe.wait == null);
try std.testing.expectEqualStrings("abc", pane.file.?.content);
try std.testing.expect(shell.lsp_task == null);
try std.testing.expectEqual(@as(usize, 0), shell.pipe_tasks.len);