Skip to content

Adjust scroll top by number of sticky headers#50359

Merged
KyleBarton merged 2 commits intomainfrom
fix_scroll_top_action_with_sticky_headers
Mar 2, 2026
Merged

Adjust scroll top by number of sticky headers#50359
KyleBarton merged 2 commits intomainfrom
fix_scroll_top_action_with_sticky_headers

Conversation

@KyleBarton
Copy link
Copy Markdown
Collaborator

In cases where sticky headers are enabled, count the number of sticky headers that would be present when performing editor:scroll cursor top. Take the maximum of that number and verical_scroll_margin so that we don't inadvertently bury the cursor behind the sticky headers.

Screen.Recording.2026-02-27.at.3.34.09.PM.mov

Closes #48864

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:

  • Fixed scroll top behavior when there are more sticky headers than vertical_scroll_margin

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 27, 2026
@KyleBarton KyleBarton merged commit 0214d6e into main Mar 2, 2026
43 of 45 checks passed
@KyleBarton KyleBarton deleted the fix_scroll_top_action_with_sticky_headers branch March 2, 2026 16:09
tahayvr pushed a commit to tahayvr/zed that referenced this pull request Mar 4, 2026
In cases where sticky headers are enabled, count the number of sticky
headers that would be present when performing `editor:scroll cursor
top`. Take the maximum of that number and `verical_scroll_margin` so
that we don't inadvertently bury the cursor behind the sticky headers.



https://github.com/user-attachments/assets/6d49fe3a-2017-4c76-bd92-c4ec9794f898



Closes zed-industries#48864

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:

- Fixed scroll top behavior when there are more sticky headers than
vertical_scroll_margin
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.

Vim zt / scrollCursorTop doesn't take sticky_scroll into account

1 participant