Skip to content

editor: Avoid autoscroll in SplitSelectionIntoLines#49399

Merged
SomeoneToIgnore merged 1 commit intozed-industries:mainfrom
it-education-md:fix/split-selection-into-lines-no-scroll
Mar 2, 2026
Merged

editor: Avoid autoscroll in SplitSelectionIntoLines#49399
SomeoneToIgnore merged 1 commit intozed-industries:mainfrom
it-education-md:fix/split-selection-into-lines-no-scroll

Conversation

@it-education-md
Copy link
Copy Markdown
Contributor

@it-education-md it-education-md commented Feb 17, 2026

Closes #48812

Summary

editor::SplitSelectionIntoLines currently triggers autoscroll and can jump to the end of a long file.
This PR makes the action explicitly no-scroll.

What changed

  • Disabled autoscroll in the unfold_ranges call inside split_selection_into_lines.
  • Switched selection update to SelectionEffects::no_scroll().

Testing

  • Added test_split_selection_into_lines_does_not_scroll.

Screenshots:

  • Before: see issue video
  • After:
image

Before you mark this PR as ready for review, make sure that you have:

  • Added a solid test coverage and/or screenshots from doing manual testing
  • Done a self-review taking into account security and performance aspects
  • Aligned any UI changes with the UI checklist

Release Notes:

  • Stop scrolling on editor::SplitSelectionIntoLines called in the long files

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Feb 17, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @it-education-md on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Feb 17, 2026
@maxdeviant maxdeviant changed the title editor: avoid autoscroll in SplitSelectionIntoLines editor: Avoid autoscroll in SplitSelectionIntoLines Feb 17, 2026
@it-education-md
Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 17, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Feb 17, 2026

The cla-bot has been summoned, and re-checked this pull request!

@SomeoneToIgnore SomeoneToIgnore self-assigned this Mar 2, 2026
Copy link
Copy Markdown
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you for fixing this — can you please rebase and do cargo fmt so I can merge this?

@it-education-md
Copy link
Copy Markdown
Contributor Author

Looks great, thank you for fixing this — can you please rebase and do cargo fmt so I can merge this?

Thanks for your review. Doing now.

@it-education-md it-education-md force-pushed the fix/split-selection-into-lines-no-scroll branch from 6e84d99 to fd987a4 Compare March 2, 2026 22:34
Copy link
Copy Markdown
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@SomeoneToIgnore SomeoneToIgnore enabled auto-merge (squash) March 2, 2026 22:43
@SomeoneToIgnore SomeoneToIgnore merged commit 465e2b5 into zed-industries:main Mar 2, 2026
29 checks passed
tahayvr pushed a commit to tahayvr/zed that referenced this pull request Mar 4, 2026
…9399)

Closes zed-industries#48812

## Summary
`editor::SplitSelectionIntoLines` currently triggers autoscroll and can
jump to the end of a long file.
This PR makes the action explicitly no-scroll.

## What changed
- Disabled autoscroll in the `unfold_ranges` call inside
`split_selection_into_lines`.
- Switched selection update to `SelectionEffects::no_scroll()`.

## Testing
- Added `test_split_selection_into_lines_does_not_scroll`.

### Screenshots:
- Before:   see issue video
- After:
<img width="2486" height="1299" alt="image"
src="https://github.com/user-attachments/assets/8408a2f1-7dd7-4984-aa89-927d5a588322"
/>


Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Stop scrolling on `editor::SplitSelectionIntoLines` called in the long
files
wzulfikar pushed a commit to wzulfikar/zed that referenced this pull request Mar 4, 2026
…9399)

Closes zed-industries#48812

## Summary
`editor::SplitSelectionIntoLines` currently triggers autoscroll and can
jump to the end of a long file.
This PR makes the action explicitly no-scroll.

## What changed
- Disabled autoscroll in the `unfold_ranges` call inside
`split_selection_into_lines`.
- Switched selection update to `SelectionEffects::no_scroll()`.

## Testing
- Added `test_split_selection_into_lines_does_not_scroll`.

### Screenshots:
- Before:   see issue video
- After:
<img width="2486" height="1299" alt="image"
src="https://github.com/user-attachments/assets/8408a2f1-7dd7-4984-aa89-927d5a588322"
/>


Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Stop scrolling on `editor::SplitSelectionIntoLines` called in the long
files
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 first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

editor::SplitSelectionIntoLines scrolls long file to the end (unlike VSCode)

2 participants