summaryrefslogtreecommitdiff
path: root/test/output.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/output.zig')
-rw-r--r--test/output.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/output.zig b/test/output.zig
index d7b8a816..a8a1f239 100644
--- a/test/output.zig
+++ b/test/output.zig
@@ -70,7 +70,7 @@ fn outputCell(p: *Pardes, surface: *pardes.Surface, id: usize, byte: usize) *par
const pane = p.panes[id].?;
const line = modal.lineSlice(pane.file.?.content, 0);
const rect = p.view().rects[id];
- const x = rect.x + config.GUTTER + panes.File.gutterWidth(pane) + @as(u16, @intCast(panes.File.displayWidth(line[0..byte])));
+ const x = rect.x + config.GUTTER + panes.File.gutterWidth(pane) + @as(u16, @intCast(panes.File.displayWidth(p.settings.tab, line[0..byte])));
const y = p.bodyTop(pane, rect);
return surface.at(x, y);
}
@@ -444,7 +444,7 @@ test "Mini syntax colors survive themes and rendering without source access" {
// Direct pane construction bypasses the host update's layout sync.
p.update(.{ .resize = .{ .cols = 80, .rows = 24 } });
const position = modal.positionAt(mini.file.?.content, keyword);
- const column = panes.File.displayWidth(modal.lineSlice(mini.file.?.content, position.row)[0..position.col]);
+ const column = panes.File.displayWidth(config.tab_width, modal.lineSlice(mini.file.?.content, position.row)[0..position.col]);
try tmp.dir.deleteFile(std.testing.io, "demo.zig");
const colors = mini.file.?.mini.?.colors.ptr;
var frame = std.heap.ArenaAllocator.init(std.testing.allocator);
@@ -937,7 +937,7 @@ test "result alignment chunks keep seventeen matches independent and refresh sta
const index = 16 - reverse;
const label = try std.fmt.allocPrint(p.gpa, "/r{d:0>2}{s}.zig:3:1", .{ index, if (index == long_at) "-界-very-long-path-name" else "-é" });
defer p.gpa.free(label);
- widths[index] = panes.File.displayWidth(label);
+ widths[index] = panes.File.displayWidth(config.tab_width, label);
try input.appendSlice(p.gpa, label);
try input.appendSlice(p.gpa, " \t return 7;\n");
}
@@ -953,7 +953,7 @@ test "result alignment chunks keep seventeen matches independent and refresh sta
const first = index / 8 * 8;
var width: usize = 0;
for (widths[first..@min(first + 8, widths.len)]) |label_width| width = @max(width, label_width);
- try std.testing.expectEqual(width, panes.File.displayWidth(line[0 .. row.code_start - 1]));
+ try std.testing.expectEqual(width, panes.File.displayWidth(config.tab_width, line[0 .. row.code_start - 1]));
try std.testing.expectEqual(@as(u8, '\t'), line[row.code_start - 1]);
try std.testing.expectEqualStrings("\t return 7;", line[row.code_start..]);
try std.testing.expectEqualStrings(row.path, line[0 .. row.location_end - ":3:1".len]);
@@ -986,7 +986,7 @@ test "result alignment chunks keep seventeen matches independent and refresh sta
const label = line[0..row.location_end];
const code = line[row.code_start..];
try legacy.appendSlice(p.gpa, label);
- const padding = global_width - panes.File.displayWidth(label);
+ const padding = global_width - panes.File.displayWidth(config.tab_width, label);
try legacy.appendNTimes(p.gpa, ' ', padding);
try legacy.append(p.gpa, '\t');
try legacy.appendSlice(p.gpa, code);
@@ -1037,7 +1037,7 @@ test "result alignment chunks assign boundary context to nearest match with prev
const line = modal.lineSlice(file.content, index);
try std.testing.expectEqual(index + 1, row.at.line);
const expected = if (row.at.line <= 10) first_label else next_label;
- try std.testing.expectEqual(panes.File.displayWidth(expected), panes.File.displayWidth(line[0 .. row.code_start - 1]));
+ try std.testing.expectEqual(panes.File.displayWidth(config.tab_width, expected), panes.File.displayWidth(config.tab_width, line[0 .. row.code_start - 1]));
try std.testing.expectEqualStrings("\t source();", line[row.code_start..]);
if (row.at.line >= 9 and row.at.line != 12) {
try std.testing.expectEqual(.context, row.kind);