Skip to content

editor: Align split buffer headers with scrollbar layout - #53782

Merged
dinocosta merged 5 commits into
zed-industries:mainfrom
cppcoffee:editor_vertical_scrollbar_width
Jun 12, 2026
Merged

editor: Align split buffer headers with scrollbar layout#53782
dinocosta merged 5 commits into
zed-industries:mainfrom
cppcoffee:editor_vertical_scrollbar_width

Conversation

@cppcoffee

@cppcoffee cppcoffee commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

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

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>
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 13, 2026
@cppcoffee
cppcoffee marked this pull request as ready for review April 13, 2026 08:50
@zed-codeowner-coordinator
zed-codeowner-coordinator Bot requested review from a team, as-cii and dinocosta and removed request for a team April 13, 2026 08:50
@dinocosta

dinocosta commented Apr 13, 2026

Copy link
Copy Markdown
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!

@cppcoffee

cppcoffee commented Apr 14, 2026

Copy link
Copy Markdown
Contributor Author

The Editor horizontal scroll bar for operation.

before:

2026-04-14.09.24.56.mov

after:

2026-04-14.10.21.59.mov

@dinocosta dinocosta assigned dinocosta and unassigned as-cii Apr 14, 2026
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 dinocosta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
dinocosta enabled auto-merge June 12, 2026 15:28
@dinocosta
dinocosta added this pull request to the merge queue Jun 12, 2026
Merged via the queue into zed-industries:main with commit 96285fc Jun 12, 2026
34 checks passed
This was referenced Jun 18, 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>
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.

3 participants