# Fix handling of \`\-\-diff\` flag \(\#33094\) · gitcafe/zed

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

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

Visibility: public

Requested revision: a7bbbc0552dd9548f82b49aa8c9beae94ff77e82

Requested commit: a7bbbc0552dd9548f82b49aa8c9beae94ff77e82

Commit: a7bbbc0552dd9548f82b49aa8c9beae94ff77e82

Tree: b29f0c0682a4d0e1a787fa9e36453a29cdb2089e

Author: Max Brunsfeld

Committer: GitHub

## Message

```
Fix handling of `--diff` flag (#33094)

* Restore the ability to combine --diff with other path arguments
* Restore combining --diff with --wait

There is still one defect in the current handling of `--diff`: when Zed
is already open, we'll open the diff view in your current active zed
window. It would be better to search all of the open zed windows for any
window containing the diffed paths, but implementing that is a bit
complex. Currently, the logic for *picking* an existing zed window is
coupled to the logic for opening buffers in that window. I'd like to
decouple it, but I wanted to keep this change small, so that we hotfix
it to stable without too much risk.

Release Notes:

- Fixed a bug where the `--diff` CLI flag did not work with `--wait`

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
```

## Parents

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

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