diff options
Diffstat (limited to 'src/edit_cmd.zig')
| -rw-r--r-- | src/edit_cmd.zig | 10 |
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. |
