Skip to content

Fix code editor tab width after horizontal scroll#2957

Open
RDeckard wants to merge 1 commit into
nesbox:mainfrom
RDeckard:fix/2940-code-tab-scroll-mapping
Open

Fix code editor tab width after horizontal scroll#2957
RDeckard wants to merge 1 commit into
nesbox:mainfrom
RDeckard:fix/2940-code-tab-scroll-mapping

Conversation

@RDeckard

Copy link
Copy Markdown
Contributor

Why

Original issue: #2940

Follow-up to #2901

The previous tab-aware mouse mapping fix (#2901) handled visible tabs, but #2940 shows a remaining mismatch after horizontal scrolling hides indentation tabs. In that case, hidden tabs could stop advancing the rendered x position by their full visual width, while mouse mapping still used visual tab columns.

What

  • Reuse the existing tab-column width calculation for code rendering.
  • Compute a tab's x advance before the visibility check, so offscreen tabs still affect later character positions.
  • Make drawTab(...) draw using the already computed visual width instead of recalculating from screen x.

Impact

This should make rendering and mouse hit testing agree better when tabs are scrolled offscreen horizontally. I have not manually reproduced the exact video case, so reviewer confirmation on the #2940 scenario would be useful.

@RDeckard RDeckard marked this pull request as ready for review June 11, 2026 23:15
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