Skip to content

Fix line numbers when soft wrap is on - #2

Merged
chasehuh merged 1 commit into
mainfrom
task/fix-wrap-gutter
Jul 14, 2026
Merged

Fix line numbers when soft wrap is on#2
chasehuh merged 1 commit into
mainfrom
task/fix-wrap-gutter

Conversation

@chasehuh

Copy link
Copy Markdown
Member

Summary

  • Soft-wrapped lines were getting mismatched gutter numbers because each gutter cell was fixed to one visual row
  • Measure each hard line's visual row count via a mirror element and stretch gutter cells to match
  • Wrap off keeps the previous 1:1 gutter behavior; ResizeObserver refreshes on width changes

Test plan

  • Open localhost with wrap enabled and a long Korean line — only one number for that hard line
  • Soft-wrap continuations have no new line number beside them
  • Toggle Settings → Editor → No wrap — numbers return to 1:1
  • Resize the editor width — gutter heights update
  • Scroll the textarea — gutter stays aligned

Made with Cursor

Measure each hard line's visual row count and stretch gutter cells so wrap no longer invents false line numbers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
memo Ready Ready Preview, Comment Jul 14, 2026 6:32am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant