summaryrefslogtreecommitdiff
path: root/src/edit_cmd.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 23:33:30 -0300
committerGabriel Schneider <[email protected]>2026-11-05 01:16:28 -0300
commit7c299a78d72274a2c101f5da0be4114f7c4dc4f3 (patch)
tree9dfebae15df4caa1da5404acb1f17f71b319cc13 /src/edit_cmd.zig
parent2504b38647653db091aa7709afcea0dbe75f7a95 (diff)
downloadpardes-7c299a78d72274a2c101f5da0be4114f7c4dc4f3.tar.gz
pardes-7c299a78d72274a2c101f5da0be4114f7c4dc4f3.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/edit_cmd.zig')
-rw-r--r--src/edit_cmd.zig10
1 files changed, 5 insertions, 5 deletions
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.