Fix #194: line-number alignment and doubled line spacing in paste viewer #202

Closed
fen wants to merge 1 commits from fix-194 into dev
Collaborator

Fixes #194

Root cause: paste-lines.js joined the display:block .codeline spans with newline text nodes. Inside the white-space: pre codebody each of those text nodes renders as an extra empty line box, doubling the visual line spacing and desyncing the gutter in both wrap and no-wrap modes.

Changes (internal/web/static/paste-lines.js only):

  • join spans with no separator (blocks need none)
  • number only real lines: a paste ending in a newline no longer gets a phantom trailing number

Verified rendered in headless Chromium against a local build: gutter/code heights match exactly (delta 0) in both modes; wrapped long lines get one gutter number per visual row with blanks on continuation rows; no-wrap keeps one number per logical line; go build ./... and go test ./... pass.

Fixes #194 Root cause: `paste-lines.js` joined the `display:block` `.codeline` spans with newline text nodes. Inside the `white-space: pre` codebody each of those text nodes renders as an extra empty line box, doubling the visual line spacing and desyncing the gutter in both wrap and no-wrap modes. Changes (internal/web/static/paste-lines.js only): - join spans with no separator (blocks need none) - number only real lines: a paste ending in a newline no longer gets a phantom trailing number Verified rendered in headless Chromium against a local build: gutter/code heights match exactly (delta 0) in both modes; wrapped long lines get one gutter number per visual row with blanks on continuation rows; no-wrap keeps one number per logical line; go build ./... and go test ./... pass.
fen added 1 commit 2026-09-10 17:12:51 +00:00
Fix #194: gutter alignment and doubled line spacing in paste viewer
CI / docker (pull_request) Skipped
CI / test (pull_request) Successful in 45s
392fa026cc
- paste-lines.js: join .codeline spans with no separator; newline text
  nodes between display:block spans in the white-space:pre container each
  rendered as an extra empty line box, doubling visual line spacing and
  desyncing the gutter in both wrap and no-wrap modes
- number only real lines: a paste ending in newline produced a phantom
  trailing number (6 for 5 lines)
Author
Collaborator
-
fen closed this pull request 2026-09-10 17:22:18 +00:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.