From 26377b95d5223549f5f2cb6e8cd6989fb78b8f30 Mon Sep 17 00:00:00 2001 From: fen Date: Thu, 10 Sep 2026 12:22:55 -0500 Subject: [PATCH] Fix #167 r3: repair renumber verify pass referencing removed tops variable e1056df (PR #200) rewrote renumber() to derive placement from rowIdx but left the post-placement verify pass reading a removed 'tops' variable; wrap-ON renumbering threw ReferenceError on every pass and the rAF re-check never ran. Rebuild 'placed' from rowIdx directly. No behavior change on the happy path; restores the reflow re-verify safety net. --- internal/web/static/paste-lines.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/web/static/paste-lines.js b/internal/web/static/paste-lines.js index 231a473..9853c3d 100644 --- a/internal/web/static/paste-lines.js +++ b/internal/web/static/paste-lines.js @@ -76,8 +76,8 @@ // settle a hair under N * line-height after the gutter is rebuilt; a // 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); + // rowIdx already holds each line's placement row for this pass. + var placed = rowIdx.slice(); requestAnimationFrame(function () { var moved = false; var tops2 = []; -- 2.54.0