# git_ui: Enable splitting MultiDiffView \(directory \`zed \-\-diff\`\) \(\#64967\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/57bfce2945c96103421bbdc4cc98fc2de5efe2fa)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 57bfce2945c96103421bbdc4cc98fc2de5efe2fa

Requested commit: 57bfce2945c96103421bbdc4cc98fc2de5efe2fa

Commit: 57bfce2945c96103421bbdc4cc98fc2de5efe2fa

Tree: a845498e8bbac2cde59c043d052dda19a72c2e13

Author: Ian Chamberlain

Committer: GitHub

## Message

````
git_ui: Enable splitting MultiDiffView (directory `zed --diff`) (#64967)

## 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
````

## Parents

- [20d29fc6bc2fc2b58d1fff8d8e0503b9ba7f41d8](https://git.cafe/gitcafe/zed/commit/20d29fc6bc2fc2b58d1fff8d8e0503b9ba7f41d8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/57bfce2945c96103421bbdc4cc98fc2de5efe2fa?format=markdown)
