Fix #167: remove undefined 'tops' reference that aborted renumber() with wrap on
CI / test (pull_request) Successful in 48s
CI / docker (pull_request) Skipped

Commit e1056df refactored renumber() to place gutter numbers by measured
.codeline geometry but left the one-frame verification pass reading the
removed 'tops' array — a ReferenceError at line 80 that aborts renumber()
before any number is assigned, leaving the wrap-ON gutter with blank filler
rows. Read the placement from the already-computed rowIdx array instead.

Verified locally (CDP bounding-box probes, 6-line paste incl. one long
unbroken token that wraps mid-word): gutter number top vs .codeline top
diff <= 0.1px for every line at 1400x900 and 375x812, wrap ON and OFF.
Wrap OFF keeps the plain '1..N' text gutter with no .gutline spans.
No console or CSP violations.
This commit is contained in:
fen
2026-09-10 12:26:14 -05:00
parent 23cf3151c4
commit ccaa1292a1
+1 -1
View File
@@ -77,7 +77,7 @@
// gutter pass that changes the code column width reflows it. Verify the
// placement one frame later and re-run if any line's row moved (#167).
var placed = {};
for (var q = 0; q < tops.length; q++) placed[q] = Math.round((tops[q] - bodyTop) / lh);
for (var q = 0; q < rowIdx.length; q++) placed[q] = rowIdx[q];
requestAnimationFrame(function () {
var moved = false;
var tops2 = [];