Skip to content

Fix multibuffer initialization based on RHS state - #56058

Merged
ChristopherBiscardi merged 1 commit into
zed-industries:mainfrom
chirivelli:fix/extra-headers-in-lhs-file-diff-view
May 7, 2026
Merged

Fix multibuffer initialization based on RHS state#56058
ChristopherBiscardi merged 1 commit into
zed-industries:mainfrom
chirivelli:fix/extra-headers-in-lhs-file-diff-view

Conversation

@chirivelli

Copy link
Copy Markdown
Collaborator

This update modifies the initialization of the left-hand side multibuffer in the SplittableEditor. It now checks if the right-hand side multibuffer is a singleton and uses a MultiBuffer::without_headers instead.

Before Screenshot:
Screenshot 2026-05-07 at 7 30 16 PM

After Screenshot:
Screenshot 2026-05-07 at 7 32 48 PM

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • The content is consistent with the UI/UX checklist

Release Notes:

  • Optimized multibuffer creation by conditionally using headers based on RHS state.

This update modifies the initialization of the left-hand side multibuffer in the SplittableEditor. It now checks if the right-hand side multibuffer is a singleton and uses a more efficient `MultiBuffer::without_headers` method when applicable, improving performance and resource management.

Release Notes:
- Optimized multibuffer creation by conditionally using headers based on RHS state.
@cla-bot

cla-bot Bot commented May 7, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @chirivelli 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 May 7, 2026
@chirivelli

chirivelli commented May 7, 2026

Copy link
Copy Markdown
Collaborator Author

@Veykril hi, I see you have the last commit related to diff in zed from the release notes from zed org, so just tagging you for review.

@cole-miller, can you review this please

@chirivelli

Copy link
Copy Markdown
Collaborator Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 7, 2026
@cla-bot

cla-bot Bot commented May 7, 2026

Copy link
Copy Markdown

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

@chirivelli
chirivelli marked this pull request as ready for review May 7, 2026 14:19
@maxdeviant maxdeviant changed the title fix: multibuffer initialization based on RHS state Fix multibuffer initialization based on RHS state May 7, 2026
@ChristopherBiscardi ChristopherBiscardi added the area:multi-buffer Feedback for multi buffers label May 7, 2026

@ChristopherBiscardi ChristopherBiscardi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This fixes the extra spacing, thanks!

@ChristopherBiscardi ChristopherBiscardi self-assigned this May 7, 2026
@ChristopherBiscardi
ChristopherBiscardi added this pull request to the merge queue May 7, 2026
Merged via the queue into zed-industries:main with commit 675ed70 May 7, 2026
50 checks passed
@chirivelli
chirivelli deleted the fix/extra-headers-in-lhs-file-diff-view branch May 7, 2026 17:49
@chirivelli
chirivelli restored the fix/extra-headers-in-lhs-file-diff-view branch May 7, 2026 17:49
@chirivelli
chirivelli deleted the fix/extra-headers-in-lhs-file-diff-view branch May 7, 2026 17:50
@chirivelli
chirivelli restored the fix/extra-headers-in-lhs-file-diff-view branch May 30, 2026 12:14
@chirivelli
chirivelli deleted the fix/extra-headers-in-lhs-file-diff-view branch June 4, 2026 13:47
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
This update modifies the initialization of the left-hand side
multibuffer in the SplittableEditor. It now checks if the right-hand
side multibuffer is a singleton and uses a
`MultiBuffer::without_headers` instead.


Before Screenshot:
<img width="1624" height="1030" alt="Screenshot 2026-05-07 at 7 30
16 PM"
src="https://github.com/user-attachments/assets/3d963703-309c-42e4-b2be-fe64bd9c0a06"
/>

After Screenshot:
<img width="1624" height="1030" alt="Screenshot 2026-05-07 at 7 32
48 PM"
src="https://github.com/user-attachments/assets/51668319-6a34-47df-b8b1-8bf58b86407e"
/>


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)



Release Notes:
- Optimized multibuffer creation by conditionally using headers based on
RHS state.
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
This update modifies the initialization of the left-hand side
multibuffer in the SplittableEditor. It now checks if the right-hand
side multibuffer is a singleton and uses a
`MultiBuffer::without_headers` instead.


Before Screenshot:
<img width="1624" height="1030" alt="Screenshot 2026-05-07 at 7 30
16 PM"
src="https://github.com/user-attachments/assets/3d963703-309c-42e4-b2be-fe64bd9c0a06"
/>

After Screenshot:
<img width="1624" height="1030" alt="Screenshot 2026-05-07 at 7 32
48 PM"
src="https://github.com/user-attachments/assets/51668319-6a34-47df-b8b1-8bf58b86407e"
/>


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)



Release Notes:
- Optimized multibuffer creation by conditionally using headers based on
RHS state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:multi-buffer Feedback for multi buffers 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.

2 participants