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
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).
Other platforms are not yet available:
- Web (tracking discussion)
Developing Zed
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
Zed source code is licensed primarily under GPL-3.0-or-later, with Apache-2.0 components where marked.
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.
Sponsorship
Zed is developed by Zed Industries, Inc., a for-profit company.
If you’d like to financially support the project, you can do so via GitHub Sponsors. Sponsorships go directly to Zed Industries and are used as general company revenue. There are no perks or entitlements associated with sponsorship.