# Fix git graph file diff view opening wrong file if a previous one is already open \(\#55595\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 11f0ca5881ee8c32728244ee5ce3abedc851010f

Requested commit: 11f0ca5881ee8c32728244ee5ce3abedc851010f

Commit: 11f0ca5881ee8c32728244ee5ce3abedc851010f

Tree: 8f511e69c7e5308742539537c443dbd55bf55e9d

Author: Jake Norris

Committer: GitHub

## Message

```
Fix git graph file diff view opening wrong file if a previous one is already open (#55595)

Fixed the portion of the open() function of the CommitView struct that
checked to see if the commit view was already open in a tab. Previously,
it did not account for files being filtered, and called
pane.activate_item() when it found a matching commit SHA open. Now, the
pane item is deleted and replaced with the new CommitView, respecting
the position of the tab. This allows for the filtered files to be
updated and work according to the expectations laid out in the mentioned
issue.

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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #55446

Release Notes:

- Fix git graph file diff view opening wrong file if a previous one is
already open

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
```

## Parents

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

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