diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-18 23:49:29 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-19 01:35:13 -0300 |
| commit | 1ca3e68f38385952fa5a2ccc3dac883ba0be71e8 (patch) | |
| tree | bffbbf9e5e5b2b929d79bd81ea805c5288896623 /test/output.zig | |
| parent | e567aadc19f58b1e36098388483294321f3502dd (diff) | |
| download | pardes-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 'test/output.zig')
| -rw-r--r-- | test/output.zig | 12 |
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); |
