## Summary
Enable split diffs for `zed --diff`, where the left and right sides are
directories.
This simply reuses the existing split diff that's already used for
single-file diffs, git UI, etc.
I believe this will make the Zed diff experience more consistent for use
cases like `git difftool`, `jj diff --tool` etc.
See #50046 for a similar change that made this work for single-file diff
views.
### Before
<img width="1624" height="975" alt="image"
src="https://github.com/user-attachments/assets/db8c0592-8bea-4b8f-9ccc-d94456fb6208"
/>
### After
<img width="1624" height="976" alt="image"
src="https://github.com/user-attachments/assets/c074cc5f-bdf7-4747-9ef5-4f77b3e42ee6"
/>
<img width="1624" height="976" alt="image"
src="https://github.com/user-attachments/assets/a97026a8-312d-4a51-a9f7-24343640237a"
/>
## Testing
1. `cargo build`
2. `zed --zed target/debug/zed --diff $left $right` (where `$left` and
`$right` are directories)
For the screenshots above, I used `jj` configuration like this. It's a
little awkward to setup because the debug build of Zed looks for grammar
files in `crates/grammars/src` to properly highlight everything
```toml
[merge-tools.zed-tester]
program = "bash"
diff-invocation-mode = "dir"
diff-args = [
"-c",
'''
dir=$PWD
cd /path/to/zed/checkout
zed-preview --zed ./target/debug/zed --wait --diff "$dir/$1" "$dir/$2"
''',
"",
"$left",
"$right"
]
```
Usage with this config: `jj show $revision --tool zed-tester` or `jj
diff -r $revisions --tool zed-tester`
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- No new UI components here, just plugging existing ones together. UX
should match what already existed for other usages of these components
- [x] Tests cover the new or changed behavior.
- In particular, added a test for the same scenario as #60914 to ensure
that it works for this view
Release Notes:
- Enable side-by-side view for multibuffer `zed --diff` of directories
57bfce2945Ian Chamberlain committed on 10/1/2026, 10:51:18 PM· committed by GitHubparent20d29fc