The paste gutter was pinned to a fixed 3ch width; with box-sizing: border-box that leaves only ~19px of content after the 10px side padding, so 2+ digit line numbers overflowed right into the code text.
Fix: paste-lines.js now sizes the gutter to the widest line number via CSSOM: calc(Nch + 20px) where N = digits of the highest line number. Numbers are right-aligned; the column matches the biggest number. Width is only written when it changes so the renumber/resize loop stays stable.
Verified with CDP probes at 1400x900 and 375x812, wrap on and off: gutter numbers end ~10-11px left of the code column, zero overlap, no CSP console entries, go build/test pass.
Fix attempt 1.
The paste gutter was pinned to a fixed `3ch` width; with box-sizing: border-box that leaves only ~19px of content after the 10px side padding, so 2+ digit line numbers overflowed right into the code text.
Fix: paste-lines.js now sizes the gutter to the widest line number via CSSOM: `calc(Nch + 20px)` where N = digits of the highest line number. Numbers are right-aligned; the column matches the biggest number. Width is only written when it changes so the renumber/resize loop stays stable.
Verified with CDP probes at 1400x900 and 375x812, wrap on and off: gutter numbers end ~10-11px left of the code column, zero overlap, no CSP console entries, go build/test pass.
Ref #257
The paste gutter was pinned to a fixed 3ch width. With box-sizing:
border-box that leaves only ~19px of content after the 10px+10px side
padding, so 2+ digit line numbers overflow right into the code text
(owner-visible from line 10, worst at 100+).
paste-lines.js now sets the gutter width to calc(Nch + 20px), where N is
the digit count of the highest line number, via CSSOM (CSP forbids
inline style attributes). Numbers were already right-aligned; the column
now matches the width of the biggest number. The width is only written
when it changes, so the resize-observer/renumber loop keeps a stable
fixed point.
fen
merged commit 1872dac8b4 into dev2026-09-17 19:38:56 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fix attempt 1.
The paste gutter was pinned to a fixed
3chwidth; with box-sizing: border-box that leaves only ~19px of content after the 10px side padding, so 2+ digit line numbers overflowed right into the code text.Fix: paste-lines.js now sizes the gutter to the widest line number via CSSOM:
calc(Nch + 20px)where N = digits of the highest line number. Numbers are right-aligned; the column matches the biggest number. Width is only written when it changes so the renumber/resize loop stays stable.Verified with CDP probes at 1400x900 and 375x812, wrap on and off: gutter numbers end ~10-11px left of the code column, zero overlap, no CSP console entries, go build/test pass.
Ref #257