editor: Align split buffer headers with scrollbar layout - #53782
Merged
dinocosta merged 5 commits intoJun 12, 2026
Conversation
Clip split buffer headers to the editor's content bounds so they no longer paint into the horizontal scrollbar area. Reuse the editor's computed right margin and horizontal scrollbar visibility instead of reimplementing scrollbar detection in split_editor_view. This keeps split headers aligned when minimap, inline blame, or scrollbar visibility change the available content area. Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
cppcoffee
marked this pull request as ready for review
April 13, 2026 08:50
zed-codeowner-coordinator
Bot
requested review from
a team,
as-cii and
dinocosta
and removed request for
a team
April 13, 2026 08:50
Member
|
Hey @cppcoffee 👋 Are you able to share some screenshots/recordings of what the before and after look like? Would probably make it easier to test these changes and see exactly what's changing in the UI. Thanks! |
Contributor
Author
|
The Editor horizontal scroll bar for operation. before: 2026-04-14.09.24.56.movafter: 2026-04-14.10.21.59.mov |
Update the way `SplitBufferHeadersElement` calculates the bounds for the `ContentMask` in order to also take into consideration that the horizontal scrollbar might be visible on the left hand side but not on the right one. This involves updating `SplitBufferHeadersElement` to now keep a reference to both left hand side and right hand side editors and checking if either is visible.
dinocosta
approved these changes
Jun 12, 2026
dinocosta
left a comment
Member
There was a problem hiding this comment.
Thank you @cppcoffee ! 🙂
I've merged main into your changes and updated accordingly, seeing as Bounds::from_corner_and_size no longer exists. There was also a case where the bug could still be triggered, in case the horizontal scrollbar was only visible on the left hand side editor, as only the right hand side editor was provided to SplitBufferHeadersElement and that editor's horizontal scrollbar visibility was driving the fix.
dinocosta
enabled auto-merge
June 12, 2026 15:28
5 tasks
This was referenced Jun 18, 2026
Closed
This was referenced Jul 1, 2026
This was referenced Jul 10, 2026
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…ies#53782) Clip split buffer headers to the editor's content bounds so they no longer paint into the horizontal scrollbar area. Reuse the editor's computed right margin and horizontal scrollbar visibility instead of reimplementing scrollbar detection in split_editor_view. This keeps split headers aligned when minimap, inline blame, or scrollbar visibility change the available content area. Release Notes: - Fixed horizontal scrollbars not being rendered behind buffer headers in split editors --------- Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com> Co-authored-by: dino <dinojoaocosta@gmail.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.
Clip split buffer headers to the editor's content bounds so they no longer paint into the horizontal scrollbar area.
Reuse the editor's computed right margin and horizontal scrollbar visibility instead of reimplementing scrollbar detection in split_editor_view. This keeps split headers aligned when minimap, inline blame, or scrollbar visibility change the available content area.
Release Notes: