Repository navigation
studio: the code editor scrolls by the columns it draws - #3141
Merged
Merged
Conversation
The horizontal view has always moved in drawn columns β a tab covers the cells up to its stop β in the drawing, in the mouse click and in the right-drag. updateEditor alone moved it by raw characters, where a tab counts as one, so on a line with tabs at tab size 2 or more the caret ran past the right edge while the view stayed put (#3138). The caret column is now counted the way the text is drawn, and the recentre uses the same count; the raw column stays for the status line and the vertical moves that follow it. Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3138.
The horizontal view has always moved in drawn columns: a tab covers the cells up to its stop in
drawCode, and the mouse click and the right-drag already map pixels to columns.updateEditoralone advancedscroll.xby the caret's raw character count, where a tab counts as one, so on a line with tabs at tab size 2 or more the caret ran past the right edge while the view stayed put. Line numbers only narrow the editor by a couple of columns and are not the cause.getVisualCursorColumncounts the caret column the way the text is drawn;updateEditorandrecenterScrolluse it forscroll.x; the raw column stays for the status line and the vertical moves;getCursorPositiontakes NULL out-params, asgetWidthsdoes, so the recentre can ask for the line alone.Checked on the desktop build with tab size 2: the caret runs off the right edge before the change and follows the view after it, and at tab size 1 nothing moves.
π€ Generated with Claude Code