Skip to content

git_ui: Support side-by-side diff view in clipboard selection diff#51966

Merged
Veykril merged 1 commit intozed-industries:mainfrom
OmChillure:git_ui/splittable-editor-diff-view
Mar 23, 2026
Merged

git_ui: Support side-by-side diff view in clipboard selection diff#51966
Veykril merged 1 commit intozed-industries:mainfrom
OmChillure:git_ui/splittable-editor-diff-view

Conversation

@OmChillure
Copy link
Copy Markdown
Contributor

@OmChillure OmChillure commented Mar 19, 2026

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 #51457. This PR contains only the SplittableEditor wiring. 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::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

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Video :

Screencast.from.2026-03-19.23-11-36.webm

Release Notes:

  • Improved "Diff Clipboard with Selection" to support side-by-side diff view style.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 19, 2026
@zed-community-bot zed-community-bot bot added the guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions label Mar 19, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team, Veykril and kubkon and removed request for a team March 19, 2026 18:28
Copy link
Copy Markdown
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

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

Thanks!

@Veykril
Copy link
Copy Markdown
Member

Veykril commented Mar 23, 2026

needs a rebase

@OmChillure OmChillure force-pushed the git_ui/splittable-editor-diff-view branch from 872109b to ab5f118 Compare March 23, 2026 08:54
@OmChillure
Copy link
Copy Markdown
Contributor Author

needs a rebase

done ! if you can approve?

thank you

@Veykril Veykril enabled auto-merge (squash) March 23, 2026 09:01
@Veykril Veykril merged commit b1e8473 into zed-industries:main Mar 23, 2026
31 checks passed
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.
@esthertrapadoux esthertrapadoux moved this to Shipped by the Guild in Zed Guild - The Board Mar 24, 2026
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 guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions

Projects

Status: Shipped by the Guild

Development

Successfully merging this pull request may close these issues.

"diff clipboard with selection" doesn't support split view

4 participants