From 7c299a78d72274a2c101f5da0be4114f7c4dc4f3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 23:33:30 -0300 Subject: selection_pipe, Pipe, edit_cmd: a pipe's inputs are plain byte slices, not a one-field Input struct, dupeAll takes them concretely (no anytype, no length argument), and an Edit's request leaves the single command and cwd empty, which runJob never reads when every input has its own Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/edit_cmd.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/edit_cmd.zig') diff --git a/src/edit_cmd.zig b/src/edit_cmd.zig index 9542f4a9..876c6157 100644 --- a/src/edit_cmd.zig +++ b/src/edit_cmd.zig @@ -217,19 +217,19 @@ pub fn run(p: *Pardes, id: usize, command: []const u8) void { const n = res.jobs.len; const commands = arena.alloc([]const u8, n) catch |err| return p.reportError(id, "Edit", err); const cwds = arena.alloc([]const u8, n) catch |err| return p.reportError(id, "Edit", err); - const inputs = arena.alloc(selection_pipe.Input, n) catch |err| return p.reportError(id, "Edit", err); + const inputs = arena.alloc([]const u8, n) catch |err| return p.reportError(id, "Edit", err); for (res.jobs, 0..) |job, i| { const f = res.files[job.file]; commands[i] = job.command; cwds[i] = arena.dupe(u8, Pardes.paneDir(p.panes[f.id].?)) catch |err| return p.reportError(id, "Edit", err); - inputs[i] = .{ .bytes = if (job.c == '<') "" else arena.dupe(u8, f.text[job.q0..job.q1]) catch |err| return p.reportError(id, "Edit", err) }; + inputs[i] = if (job.c == '<') "" else arena.dupe(u8, f.text[job.q0..job.q1]) catch |err| return p.reportError(id, "Edit", err); } p.pipe.seq +%= 1; pd.id = p.pipe.seq; pd.request = .{ .id = pd.id, - .command = commands[0], - .cwd = cwds[0], + .command = "", + .cwd = "", .inputs = inputs, .commands = commands, .cwds = cwds, @@ -500,7 +500,7 @@ test "Edit , | sort runs off the loop, through the session's shell in the file's try testing.expectEqualStrings("b\na\nc\n", p.panes[0].?.file.?.content); const req = p.pipe.pipeRequest(p.pipe.edit_run.?.id).?; try testing.expectEqualStrings("sort", req.commands[0]); - try testing.expectEqualStrings("b\na\nc\n", req.inputs[0].bytes); + try testing.expectEqualStrings("b\na\nc\n", req.inputs[0]); try testing.expectEqualStrings("/", req.cwds[0]); try testing.expectEqualStrings(p.shellBin(), req.shell); // An Edit that would change the file being filtered is busy. -- cgit v1.3