Skip to content

Stop centering when selecting larger syntax nodes#28172

Merged
P1n3appl3 merged 1 commit intozed-industries:mainfrom
P1n3appl3:syntax-node
Apr 7, 2025
Merged

Stop centering when selecting larger syntax nodes#28172
P1n3appl3 merged 1 commit intozed-industries:mainfrom
P1n3appl3:syntax-node

Conversation

@P1n3appl3
Copy link
Copy Markdown
Contributor

With #27295, the cursor would center upon running SelectLargerSyntaxNode. This was done to provide more context when making large selections, but when making small selections (such as a single parameter in an argument list) it was confusing that the scroll position jumped.

This change makes that behavior slightly more conservative: now when the selection is small enough to fit on the screen scrolling will only occur to keep the cursor position on the screen (including respecting vertical_scroll_margin).

Release Notes:

  • N/A

Co-authored-by: João Marcos <marcospb19@hotmail.com>
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Apr 6, 2025
@P1n3appl3 P1n3appl3 merged commit 656302e into zed-industries:main Apr 7, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant