diff options
Diffstat (limited to 'core/Pipe.zig')
| -rw-r--r-- | core/Pipe.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/Pipe.zig b/core/Pipe.zig index 59613222..85329971 100644 --- a/core/Pipe.zig +++ b/core/Pipe.zig @@ -281,7 +281,7 @@ pub fn pipeResponse( m += 1; } if (m == 0) return; - return t.setRanges(content, kept[0..m], &.{}, pri orelse m - 1, wait.explicit); + return t.setRanges(p.settings.tab, content, kept[0..m], &.{}, pri orelse m - 1, wait.explicit); } // Each range's cut with its output in place, in order: one splice of @@ -320,9 +320,9 @@ pub fn pipeResponse( }; edit.setEditText(p.editor(), t, replacement) catch |err| return p.reportError(wait.pane, "pipe", err); const now = edit.flatSurface(p.editor(), t) catch |err| return p.reportError(wait.pane, "pipe", err); - t.setRanges(now, new_ranges[0..n], &.{}, wait.primary, wait.explicit); + t.setRanges(p.settings.tab, now, new_ranges[0..n], &.{}, wait.primary, wait.explicit); t.select = false; - t.show(); + t.show(p.settings.tab); } fn nextPipeEffect(p: *Pardes) ?u32 { @@ -402,7 +402,7 @@ test "$ keeps the selections the command exits 0 on, and a real shell gives that .{ .anchor = 3, .head = 5 }, .{ .anchor = 6, .head = 8 }, }; - pane.body.setRanges(pane.file.?.content, &ranges, &.{}, 1, true); + pane.body.setRanges(config.tab_width, pane.file.?.content, &ranges, &.{}, 1, true); p.update(.{ .key = .{ .cp = '$' } }); try std.testing.expectEqualStrings(config.pipe_marker_keep, pane.promptText().?); p.update(.{ .key = .{ .cp = 'g', .text = "grep -v b" } }); @@ -438,7 +438,7 @@ test "selection pipe replaces all ranges atomically and undo restores them" { .{ .anchor = 0, .head = 2 }, .{ .anchor = 6, .head = 8 }, }; - pane.body.setRanges(pane.file.?.content, &ranges, &.{}, 0, true); + pane.body.setRanges(config.tab_width, pane.file.?.content, &ranges, &.{}, 0, true); p.update(.{ .key = .{ .cp = '|' } }); p.update(.{ .key = .{ .cp = 'c', .text = "cat" } }); @@ -472,7 +472,7 @@ test "a pipe's output past its cap leaves the text as it was, and says so" { while (p.nextEffect()) |_| {} const pane = try p.setTestFile("aa bb cc\n"); const ranges = [_]modal.Selection{ .{ .anchor = 0, .head = 2 }, .{ .anchor = 6, .head = 8 } }; - pane.body.setRanges(pane.file.?.content, &ranges, &.{}, 1, true); + pane.body.setRanges(config.tab_width, pane.file.?.content, &ranges, &.{}, 1, true); p.update(.{ .key = .{ .cp = '|' } }); p.update(.{ .key = .{ .cp = 'c', .text = "cat" } }); p.update(.{ .key = .{ .cp = Key.enter } }); @@ -510,7 +510,7 @@ test "the four shell behaviours put their output where helix puts it" { defer p.deinit(); while (p.nextEffect()) |_| {} const pane = try p.setTestFile("aa bb cc\n"); - pane.body.setRanges(pane.file.?.content, &.{.{ .anchor = 3, .head = 5 }}, &.{}, 0, true); + pane.body.setRanges(config.tab_width, pane.file.?.content, &.{.{ .anchor = 3, .head = 5 }}, &.{}, 0, true); p.update(.{ .key = case.key }); for ("cmd") |c| p.update(.{ .key = .{ .cp = c, .text = &.{c} } }); @@ -531,7 +531,7 @@ test "a command with no stdin runs once and every cursor gets that one answer" { .{ .anchor = 0, .head = 2 }, .{ .anchor = 6, .head = 8 }, }; - pane.body.setRanges(pane.file.?.content, &ranges, &.{}, 0, true); + pane.body.setRanges(config.tab_width, pane.file.?.content, &ranges, &.{}, 0, true); p.update(.{ .key = .{ .cp = '!' } }); // insert-output: no stdin for ("date") |c| p.update(.{ .key = .{ .cp = c, .text = &.{c} } }); |
