summaryrefslogtreecommitdiff
path: root/core/Tables.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-18 23:49:29 -0300
committerGabriel Schneider <[email protected]>2026-11-19 01:35:13 -0300
commit1ca3e68f38385952fa5a2ccc3dac883ba0be71e8 (patch)
treebffbbf9e5e5b2b929d79bd81ea805c5288896623 /core/Tables.zig
parente567aadc19f58b1e36098388483294321f3502dd (diff)
downloadpardes-1ca3e68f38385952fa5a2ccc3dac883ba0be71e8.tar.gz
pardes-1ca3e68f38385952fa5a2ccc3dac883ba0be71e8.zip
core: nothing of a core is a process global, the three that were (pardes-probes P3, the reorganisation's 12c): config.tab_now goes, a tab's width is the core's settings.tab handed to every width function as `tab` (File.graphemeDisplayWidth and the 73 functions above it, test helpers among them, that had no core to read it from gained the parameter; an Editor, a Surface and the hunks' Ctx carry it; render sets Surface.tab; graphemeDisplayWidth asks its one printable ASCII byte before the tab, the two disjoint: with the tab first, as before, the parameter cost 0.2-1.7% instructions an operation in pardes-perf, with ASCII first the measured cells use 2-16% fewer than the base), so a rollback can no longer leave a stale width and replica.zig's hand-made put-back in toConfirmed goes; Addon.distrusted/ndistrusted become Addon.Distrusted, the client's own list, which its frontend owns across its joins and hands each core as Options.distrusted (in no tape, dump or digest: Options' replica .local); Kind.draw_tokens becomes each slot's `draws` (local: a draw is a frame's, so each process's count differs and no digest may hold it; the copy saves it with the slot); the two turn reads in a step stay, being shown unable to reach a client's state (the report); the soak's Proc keeps only the client's list (its tab_now and the global swaps go, forced); test/perf.zig follows three signatures, so unit-test's perf check now says BaselineHarnessMismatch until the baselines are recorded again; tui core-test 824/966 (142 skipped), shell-test 1001/1004, pane-test 183/184, behaviour-test 274/274 and --replay 274/274, process-test 2 of 144 failed (lspcomplete, lspcompletemoved), replicas --clients 5 diverged 0 unequal 0 deltas wrong 0 quiet differ 0 at 30/80/207 ms, gui unit-test 1598/1602, lib-test, daemon.py plain, --far, --games, --window-clients pass
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/Tables.zig')
-rw-r--r--core/Tables.zig104
1 files changed, 52 insertions, 52 deletions
diff --git a/core/Tables.zig b/core/Tables.zig
index 0ec69186..dc667b7c 100644
--- a/core/Tables.zig
+++ b/core/Tables.zig
@@ -134,7 +134,7 @@ pub fn find(t: *const Tables, line: usize) ?*const Table {
/// as it is). After one edit (File.State.splice) the tables it did not
/// touch shift and only the block around it is read again (`reflow`): a
/// keystroke costs its table, not the file.
-pub fn ensure(t: *Tables, gpa: std.mem.Allocator, f: *File.State) void {
+pub fn ensure(t: *Tables, tab: u16, gpa: std.mem.Allocator, f: *File.State) void {
if (t.current(f)) return;
defer {
t.revision = f.revision;
@@ -159,20 +159,20 @@ pub fn ensure(t: *Tables, gpa: std.mem.Allocator, f: *File.State) void {
// read: it goes on.
if (lineHolding(starts, f.splice.head) >= r.n) {
t.lines = starts.len;
- t.go(gpa, f.content, 0, first_lines);
+ t.go(tab, gpa, f.content, 0, first_lines);
return;
}
- } else if (t.reflow(gpa, f)) |_| return else |_| {}
+ } else if (t.reflow(tab, gpa, f)) |_| return else |_| {}
}
t.begin(starts.len);
- t.go(gpa, f.content, 0, first_lines);
+ t.go(tab, gpa, f.content, 0, first_lines);
}
/// A frame's more of a reading under way: on the session's tick, so a core
/// that draws reads exactly as far as one that does not.
-pub fn step(t: *Tables, gpa: std.mem.Allocator, f: *File.State) void {
- t.ensure(gpa, f);
- if (t.pending != null) t.go(gpa, f.content, frame_ns, std.math.maxInt(u32));
+pub fn step(t: *Tables, tab: u16, gpa: std.mem.Allocator, f: *File.State) void {
+ t.ensure(tab, gpa, f);
+ if (t.pending != null) t.go(tab, gpa, f.content, frame_ns, std.math.maxInt(u32));
}
/// Whether a reading of the text is still under way (Pardes.nextWake).
@@ -194,9 +194,9 @@ fn begin(t: *Tables, lines: usize) void {
/// Read on for about `budget_ns` (0: no clock) or `max_lines`, whichever
/// ends first. On no memory there are no tables (the text is shown as it is).
-fn go(t: *Tables, gpa: std.mem.Allocator, content: []const u8, budget_ns: u64, max_lines: u32) void {
+fn go(t: *Tables, tab: u16, gpa: std.mem.Allocator, content: []const u8, budget_ns: u64, max_lines: u32) void {
var at = t.pending orelse return;
- const done = t.scanFrom(gpa, content, &at, std.math.maxInt(u32), true, budget_ns, max_lines) catch {
+ const done = t.scanFrom(tab, gpa, content, &at, std.math.maxInt(u32), true, budget_ns, max_lines) catch {
t.list.clearRetainingCapacity();
t.pending = null;
return;
@@ -227,7 +227,7 @@ fn lineHolding(starts: []const usize, at: usize) usize {
/// lines it added), the block around it read again. error.Whole when the
/// edit could change what a line far from it is (a fence line in it), or
/// the block is unbounded.
-fn reflow(t: *Tables, gpa: std.mem.Allocator, f: *File.State) !void {
+fn reflow(t: *Tables, tab: u16, gpa: std.mem.Allocator, f: *File.State) !void {
const content = f.content;
const starts = try File.lineIndex(gpa, f);
const sp = f.splice;
@@ -300,7 +300,7 @@ fn reflow(t: *Tables, gpa: std.mem.Allocator, f: *File.State) !void {
const prev_blank = r0 == 0 or blank(prev) or fenceOf(prev) != null or std.mem.startsWith(u8, prev[@min(indentOf(prev), prev.len)..], "#");
const head = lineOf(content, starts, r0);
var at: Resume = .{ .at = head.start, .n = head.n, .fence = null, .prev_blank = prev_blank };
- _ = try t.scanFrom(gpa, content, &at, @intCast(r1), false, 0, std.math.maxInt(u32));
+ _ = try t.scanFrom(tab, gpa, content, &at, @intCast(r1), false, 0, std.math.maxInt(u32));
const fresh = try gpa.dupe(Table, t.list.items[before..]);
defer gpa.free(fresh);
t.list.shrinkRetainingCapacity(before);
@@ -492,19 +492,19 @@ fn delimiterCells(text: []const u8, out: *[max_cols]Align) ?usize {
}
/// The display width of a cell's bytes; ASCII is a cell a byte.
-fn widthOf(text: []const u8) usize {
- for (text) |b| if (b < 0x20 or b >= 0x7f) return File.displayWidth(text);
+fn widthOf(tab: u16, text: []const u8) usize {
+ for (text) |b| if (b < 0x20 or b >= 0x7f) return File.displayWidth(tab, text);
return text.len;
}
/// Find the tables of `content`, in place of the ones there were.
-pub fn scan(t: *Tables, gpa: std.mem.Allocator, content: []const u8) !void {
+pub fn scan(t: *Tables, tab: u16, gpa: std.mem.Allocator, content: []const u8) !void {
t.list.clearRetainingCapacity();
t.widths.clearRetainingCapacity();
t.aligns.clearRetainingCapacity();
t.begin(std.mem.count(u8, content, "\n") + 1);
var at = t.pending.?;
- _ = try t.scanFrom(gpa, content, &at, std.math.maxInt(u32), true, 0, std.math.maxInt(u32));
+ _ = try t.scanFrom(tab, gpa, content, &at, std.math.maxInt(u32), true, 0, std.math.maxInt(u32));
t.pending = null;
}
@@ -512,7 +512,7 @@ pub fn scan(t: *Tables, gpa: std.mem.Allocator, content: []const u8) !void {
/// appending them; with `fences`, keep the fences. With a budget, stop
/// when it is spent, `at` where to go on from. Whether it reached the end
/// (or `stop`).
-fn scanFrom(t: *Tables, gpa: std.mem.Allocator, content: []const u8, at: *Resume, stop: u32, fences: bool, budget_ns: u64, max_lines: u32) !bool {
+fn scanFrom(t: *Tables, tab: u16, gpa: std.mem.Allocator, content: []const u8, at: *Resume, stop: u32, fences: bool, budget_ns: u64, max_lines: u32) !bool {
var fence = at.fence;
var prev_blank = at.prev_blank;
var line = lineAt(content, at.at, at.n);
@@ -552,7 +552,7 @@ fn scanFrom(t: *Tables, gpa: std.mem.Allocator, content: []const u8, at: *Resume
// unless one ends it too (`| a |`, not `| a`).
const lone = header.n + header.more == @intFromBool(header.leading) and !(header.leading and header.trailing);
if (!lone and header.cells() == count) {
- const last = try t.add(gpa, content, l, delimiter, aligns[0..@min(count, max_cols)]);
+ const last = try t.add(tab, gpa, content, l, delimiter, aligns[0..@min(count, max_cols)]);
line = nextLine(content, last);
prev_blank = false;
continue;
@@ -568,7 +568,7 @@ fn scanFrom(t: *Tables, gpa: std.mem.Allocator, content: []const u8, at: *Resume
/// Take the table whose header is `header`: its rows, its columns' widths
/// and its width. Returns its last row's line.
-fn add(t: *Tables, gpa: std.mem.Allocator, content: []const u8, header: Line, delimiter: Line, aligns: []const Align) !Line {
+fn add(t: *Tables, tab: u16, gpa: std.mem.Allocator, content: []const u8, header: Line, delimiter: Line, aligns: []const Align) !Line {
var last = delimiter;
while (nextLine(content, last)) |row| {
if (blank(row.text) or interrupts(row.text)) break;
@@ -581,11 +581,11 @@ fn add(t: *Tables, gpa: std.mem.Allocator, content: []const u8, header: Line, de
var row: ?Line = header;
while (row) |r| : (row = if (r.n == last.n) null else nextLine(content, r)) {
const pipes = Pipes.of(r.text);
- if (pipes.leading) table.lead = @max(table.lead, @as(u16, @intCast(@min(widthOf(r.text[0..pipes.at[0]]), std.math.maxInt(u16)))));
+ if (pipes.leading) table.lead = @max(table.lead, @as(u16, @intCast(@min(widthOf(tab, r.text[0..pipes.at[0]]), std.math.maxInt(u16)))));
var k: usize = 0;
while (k < max_cols) : (k += 1) {
const stop = pipes.end(k) orelse break;
- const w: u16 = @intCast(@min(widthOf(r.text[pipes.start(k)..stop]), std.math.maxInt(u16)));
+ const w: u16 = @intCast(@min(widthOf(tab, r.text[pipes.start(k)..stop]), std.math.maxInt(u16)));
if (k >= table.cols) {
try t.widths.append(gpa, w);
try t.aligns.append(gpa, if (k < aligns.len) aligns[k] else .left);
@@ -597,8 +597,8 @@ fn add(t: *Tables, gpa: std.mem.Allocator, content: []const u8, header: Line, de
row = header;
var buf: [max_pads]Pad = undefined;
while (row) |r| : (row = if (r.n == last.n) null else nextLine(content, r)) {
- var width = widthOf(r.text);
- for (t.padsOf(&table, r.n, r.text, &buf)) |pad| width += pad.cells;
+ var width = widthOf(tab, r.text);
+ for (t.padsOf(tab, &table, r.n, r.text, &buf)) |pad| width += pad.cells;
table.width = @max(table.width, @as(u32, @intCast(@min(width, std.math.maxInt(u32)))));
}
try t.list.append(gpa, table);
@@ -608,11 +608,11 @@ fn add(t: *Tables, gpa: std.mem.Allocator, content: []const u8, header: Line, de
/// The pads of one of `table`'s rows, by byte, in order. No pad is ever at
/// byte 0: a row is drawn from its first byte, so there is no cell before
/// it to give.
-pub fn padsOf(t: *const Tables, table: *const Table, line: usize, text: []const u8, out: *[max_pads]Pad) []Pad {
+pub fn padsOf(t: *const Tables, tab: u16, table: *const Table, line: usize, text: []const u8, out: *[max_pads]Pad) []Pad {
const pipes = Pipes.of(text);
var n: usize = 0;
if (pipes.leading and pipes.at[0] > 0) {
- const w = widthOf(text[0..pipes.at[0]]);
+ const w = widthOf(tab, text[0..pipes.at[0]]);
if (w < table.lead) {
out[n] = .{ .at = pipes.at[0], .cells = @intCast(table.lead - w) };
n += 1;
@@ -622,7 +622,7 @@ pub fn padsOf(t: *const Tables, table: *const Table, line: usize, text: []const
while (k < table.cols) : (k += 1) {
const stop = pipes.end(k) orelse break;
const from = pipes.start(k);
- const w = widthOf(text[from..stop]);
+ const w = widthOf(tab, text[from..stop]);
const want = t.widths.items[table.col0 + k];
if (w >= want) continue;
const missing: u16 = @intCast(want - w);
@@ -676,7 +676,7 @@ pub fn between(pads: []const Pad, from: usize, to: usize) i32 {
/// The byte at display column `col` of a row shown from byte `from`, its
/// pads counted: a pad's cells are its byte's, as a tab's are the tab's.
/// Past the end, a virtual column a cell (File.rawAtDisplay).
-pub fn byteAt(text: []const u8, pads: []const Pad, from_raw: usize, col: usize) usize {
+pub fn byteAt(tab: u16, text: []const u8, pads: []const Pad, from_raw: usize, col: usize) usize {
if (from_raw >= text.len) return from_raw +| col;
var at = modal.graphemeStart(text, from_raw);
var k: usize = 0;
@@ -689,7 +689,7 @@ pub fn byteAt(text: []const u8, pads: []const Pad, from_raw: usize, col: usize)
if (col < used) return at;
}
const end = modal.nextGrapheme(text, at);
- used += File.graphemeDisplayWidth(text[at..end]);
+ used += File.graphemeDisplayWidth(tab, text[at..end]);
if (col < used) return at;
at = end;
}
@@ -727,11 +727,11 @@ pub fn paint(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, tx: u16, tw:
const body_y = p.bodyTop(pane, r);
var vr: u16 = 0;
while (vr < body_h) : (vr += 1) {
- const w = pane.wrapAt(vr);
+ const w = pane.wrapAt(p.settings.tab, vr);
const table = File.rowTable(pane, w.line) orelse continue;
const text = File.sourceLine(pane, w.line);
var buf: [max_pads]Pad = undefined;
- const pads = f.tables.padsOf(table, @intCast(w.line), text, &buf);
+ const pads = f.tables.padsOf(p.settings.tab, table, @intCast(w.line), text, &buf);
const pipes = Pipes.of(text);
const delimiter = w.line == table.first + 1;
const header = w.line == table.first;
@@ -759,7 +759,7 @@ pub fn paint(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, tx: u16, tw:
if (col >= tw) break;
}
const end = modal.nextGrapheme(text, at);
- const cells = File.graphemeDisplayWidth(text[at..end]);
+ const cells = File.graphemeDisplayWidth(p.settings.tab, text[at..end]);
const cell = s.at(tx + @as(u16, @intCast(col)), y);
const pipe = q < pipes.n and pipes.at[q] == at;
if (pipe) {
@@ -819,7 +819,7 @@ fn testPane(p: *Pardes, content: []const u8, frame: std.mem.Allocator) !*Pane {
test "tables: a pipe table's columns, alignments and pads, by line" {
var t: Tables = .{};
defer t.deinit(testing.allocator);
- try t.scan(testing.allocator, sample);
+ try t.scan(config.tab_width, testing.allocator, sample);
try testing.expectEqual(@as(usize, 1), t.list.items.len);
const table = t.list.items[0];
try testing.expectEqual(@as(u32, 2), table.first);
@@ -832,11 +832,11 @@ test "tables: a pipe table's columns, alignments and pads, by line" {
const fig = "| fig || |";
try testing.expectEqualSlices(Pad, &.{
.{ .at = 6, .cells = 2 }, .{ .at = 7, .cells = 5 }, .{ .at = 8, .cells = 8 }, .{ .at = 9, .cells = 8 },
- }, t.padsOf(&table, 6, fig, &buf));
+ }, t.padsOf(config.tab_width, &table, 6, fig, &buf));
// `| apple | 3 | red |`: right-aligned 3 pads before its first byte.
try testing.expectEqualSlices(Pad, &.{
.{ .at = 9, .cells = 2 }, .{ .at = 13, .cells = 6 }, .{ .at = 18, .cells = 6 },
- }, t.padsOf(&table, 4, "| apple | 3 | red |", &buf));
+ }, t.padsOf(config.tab_width, &table, 4, "| apple | 3 | red |", &buf));
// Every row laid out is one width: the table's.
try testing.expectEqual(@as(u32, 1 + 7 + 1 + 5 + 1 + 17 + 1), table.width);
// Not tables: a fence's rows, counts that differ, a delimiter alone.
@@ -846,7 +846,7 @@ test "tables: a pipe table's columns, alignments and pads, by line" {
"|---|---|\n",
"| a\n|---\n",
}) |text| {
- try t.scan(testing.allocator, text);
+ try t.scan(config.tab_width, testing.allocator, text);
try testing.expectEqual(@as(usize, 0), t.list.items.len);
}
}
@@ -854,26 +854,26 @@ test "tables: a pipe table's columns, alignments and pads, by line" {
test "tables: every byte's cell maps back to it, and every pad cell to the byte after it" {
var t: Tables = .{};
defer t.deinit(testing.allocator);
- try t.scan(testing.allocator, sample);
+ try t.scan(config.tab_width, testing.allocator, sample);
const table = &t.list.items[0];
var lines = std.mem.splitScalar(u8, sample, '\n');
var n: usize = 0;
while (lines.next()) |text| : (n += 1) {
if (n < table.first or n >= table.end) continue;
var buf: [max_pads]Pad = undefined;
- const pads = t.padsOf(table, n, text, &buf);
+ const pads = t.padsOf(config.tab_width, table, n, text, &buf);
var col: usize = 0;
for (text, 0..) |_, b| {
// The pad before b: each of its cells is b's.
- const start = File.displayWidth(text[0..b]) + @as(usize, @intCast(between(pads, 0, b)));
- while (col < start) : (col += 1) try testing.expectEqual(b, byteAt(text, pads, 0, col));
- try testing.expectEqual(b, byteAt(text, pads, 0, col));
+ const start = File.displayWidth(config.tab_width, text[0..b]) + @as(usize, @intCast(between(pads, 0, b)));
+ while (col < start) : (col += 1) try testing.expectEqual(b, byteAt(config.tab_width, text, pads, 0, col));
+ try testing.expectEqual(b, byteAt(config.tab_width, text, pads, 0, col));
col += 1;
}
// Past the end, a virtual column a cell.
- try testing.expectEqual(text.len + 2, byteAt(text, pads, 0, col + 2));
+ try testing.expectEqual(text.len + 2, byteAt(config.tab_width, text, pads, 0, col + 2));
// From a scrolled start, the pads before it are not counted.
- try testing.expectEqual(@as(usize, 2), byteAt(text, pads, 2, 0));
+ try testing.expectEqual(@as(usize, 2), byteAt(config.tab_width, text, pads, 2, 0));
}
}
@@ -892,7 +892,7 @@ test "tables: a markdown table is drawn aligned, its bytes in order, the caret a
const text = File.sourceLine(pane, @intCast(line));
var k: usize = 0;
for (text, 0..) |b, i| {
- const x = text_x + @as(u16, @intCast(File.displayOffset(pane, @intCast(line), 0, @intCast(i))));
+ const x = text_x + @as(u16, @intCast(File.displayOffset(config.tab_width, pane, @intCast(line), 0, @intCast(i))));
const cell = p.surface.at(x, body_y + @as(u16, @intCast(line)));
if (b == '|') {
if (pipe_x[k]) |want| try testing.expectEqual(want, x) else pipe_x[k] = x;
@@ -927,20 +927,20 @@ test "tables: a markdown table is drawn aligned, its bytes in order, the caret a
while (col < pipe_x[3].? - text_x + 1) : (col += 1) {
p.update(.{ .mouse = .{ .button = config.select_button, .kind = .press, .col = text_x + col, .row = y } });
p.update(.{ .mouse = .{ .button = config.select_button, .kind = .release, .col = text_x + col, .row = y } });
- const want = File.byteAtRowDisplay(pane, fig, 0, col);
+ const want = File.byteAtRowDisplay(config.tab_width, pane, fig, 0, col);
try testing.expectEqual(fig, pane.body.cur_row);
try testing.expectEqual(want, pane.body.cur_col);
try testing.expect(want < text.len);
_ = frame.reset(.retain_capacity);
_ = try p.render(frame.allocator());
const caret = p.surface.cursor orelse return error.NoCaret;
- try testing.expectEqual(text_x + @as(u16, @intCast(File.displayOffset(pane, fig, 0, want))), caret.x);
+ try testing.expectEqual(text_x + @as(u16, @intCast(File.displayOffset(config.tab_width, pane, fig, 0, want))), caret.x);
// The caret is on the cell clicked, or on the glyph after its pad.
try testing.expect(caret.x >= text_x + col);
}
// A pad cell: the empty second cell's five, all the `|` after them.
const empty_x = pipe_x[1].? - text_x + 1;
- for (0..5) |i| try testing.expectEqual(@as(i32, 7), File.byteAtRowDisplay(pane, fig, 0, @intCast(empty_x + i)));
+ for (0..5) |i| try testing.expectEqual(@as(i32, 7), File.byteAtRowDisplay(config.tab_width, pane, fig, 0, @intCast(empty_x + i)));
}
test "tables: typing in a cell re-aligns the table live, and j/k keep the column shown" {
@@ -964,7 +964,7 @@ test "tables: typing in a cell re-aligns the table live, and j/k keep the column
for (text, 0..) |b, i| {
if (b != '|') continue;
k += 1;
- if (k == 3) try testing.expectEqual(@as(i32, 1 + 7 + 1 + 12), File.displayOffset(pane, @intCast(line), 0, @intCast(i)));
+ if (k == 3) try testing.expectEqual(@as(i32, 1 + 7 + 1 + 12), File.displayOffset(config.tab_width, pane, @intCast(line), 0, @intCast(i)));
}
}
// k from the kiwi row's `and` keeps its screen column: the apple
@@ -974,10 +974,10 @@ test "tables: typing in a cell re-aligns the table live, and j/k keep the column
pane.body.cur_col = @intCast(std.mem.indexOf(u8, File.sourceLine(pane, 5), "and").?);
pane.body.vsel.active = false;
pane.body.sticky_col = -1;
- const shown = File.displayOffset(pane, 5, 0, pane.body.cur_col);
+ const shown = File.displayOffset(config.tab_width, pane, 5, 0, pane.body.cur_col);
p.update(.{ .key = .{ .cp = 'k', .text = "k" } });
try testing.expectEqual(@as(i32, 4), pane.body.cur_row);
- try testing.expectEqual(shown, File.displayOffset(pane, 4, 0, pane.body.cur_col));
+ try testing.expectEqual(shown, File.displayOffset(config.tab_width, pane, 4, 0, pane.body.cur_col));
}
test "tables: an edit's tables, shifted and found again around it, are the whole text's" {
@@ -1004,9 +1004,9 @@ test "tables: an edit's tables, shifted and found again around it, are the whole
@memcpy(new[at + grow ..], old[at + cut ..]);
const scans = f.tables.scans;
File.setContent(p, f, new);
- f.tables.ensure(p.gpa, f);
+ f.tables.ensure(config.tab_width, p.gpa, f);
if (f.tables.scans == scans) reflowed += 1;
- try whole.scan(testing.allocator, f.content);
+ try whole.scan(config.tab_width, testing.allocator, f.content);
testing.expectEqual(whole.list.items.len, f.tables.list.items.len) catch |e| {
std.debug.print("round {d}\n{s}\n", .{ round, f.content });
return e;
@@ -1060,7 +1060,7 @@ test "tables: a big text's tables are read a frame's budget at a time from the t
try testing.expect(reached < File.nlines(p.gpa, f));
var whole: Tables = .{};
defer whole.deinit(testing.allocator);
- try whole.scan(testing.allocator, f.content);
+ try whole.scan(config.tab_width, testing.allocator, f.content);
try testing.expectEqual(whole.list.items.len, f.tables.list.items.len);
for (whole.list.items, f.tables.list.items) |w, mine| {
try testing.expectEqual(w.first, mine.first);
@@ -1079,7 +1079,7 @@ test "tables: a table wider than a wrapping pane is shown as its source, laid ou
try testing.expect(File.wrapWidth(pane, true) < 34);
try testing.expect(File.rowTable(pane, 2) == null);
// Source: a pipe is a pipe, at its source column.
- try testing.expectEqual(@as(i32, 7), File.displayOffset(pane, 5, 0, 7));
+ try testing.expectEqual(@as(i32, 7), File.displayOffset(config.tab_width, pane, 5, 0, 7));
try testing.expect(p.executeBuiltinLine(0, "Wrap off"));
p.sync();
_ = frame.reset(.retain_capacity);