git_ui: Support side-by-side diff view in clipboard selection diff#51966
Merged
Veykril merged 1 commit intozed-industries:mainfrom Mar 23, 2026
Merged
Conversation
This was referenced Mar 19, 2026
3 tasks
Member
|
needs a rebase |
872109b to
ab5f118
Compare
Contributor
Author
done ! if you can approve? thank you |
AmaanBilwar
pushed a commit
to AmaanBilwar/zed
that referenced
this pull request
Mar 23, 2026
…ed-industries#51966) #### Context Switches `TextDiffView` from using `Editor` directly to `SplittableEditor`, enabling side-by-side diff view support for "Diff Clipboard with Selection". The diff view now respects the user's `diff_view_style` setting. Split out from zed-industries#51457. This PR contains only the `SplittableEditor` wiring. The multibuffer coordinate fix for non-singleton editors will follow in a separate PR. Closes zed-industries#50912 (partially) #### How to Review Small PR — all changes are in `crates/git_ui/src/text_diff_view.rs`. Focus on: - `new()`: `SplittableEditor::new` replaces `Editor::for_multibuffer`, editor-specific setup goes through `rhs_editor()` - Item trait delegation: `act_as_type`, `for_each_project_item`, `set_nav_history` updated for `SplittableEditor` - Tests: pinned `DiffViewStyle::Unified` and assertions go through `rhs_editor()` #### Self-Review Checklist - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable #### Video : [Screencast from 2026-03-19 23-11-36.webm](https://github.com/user-attachments/assets/c5a2381d-238d-43ef-ac6f-9994996c0c69) #### Release Notes: - Improved "Diff Clipboard with Selection" to support side-by-side diff view style.
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.
Context
Switches
TextDiffViewfrom usingEditordirectly toSplittableEditor, enabling side-by-side diff view support for "Diff Clipboard with Selection". The diff view now respects the user'sdiff_view_stylesetting.Split out from #51457. This PR contains only the
SplittableEditorwiring. The multibuffer coordinate fix for non-singleton editors will follow in a separate PR.Closes #50912 (partially)
How to Review
Small PR — all changes are in
crates/git_ui/src/text_diff_view.rs. Focus on:new():SplittableEditor::newreplacesEditor::for_multibuffer, editor-specific setup goes throughrhs_editor()act_as_type,for_each_project_item,set_nav_historyupdated forSplittableEditorDiffViewStyle::Unifiedand assertions go throughrhs_editor()Self-Review Checklist
Video :
Screencast.from.2026-03-19.23-11-36.webm
Release Notes: