# git_ui: Fix select next/previous entry selects non-visible entry when tree view is enabled \(\#45030\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ab4cd95e9c05fa786dc36934b683995e13c4a99f

Requested commit: ab4cd95e9c05fa786dc36934b683995e13c4a99f

Commit: ab4cd95e9c05fa786dc36934b683995e13c4a99f

Tree: 8cf0d37f446daab974fc040007dfc978fa8c503c

Author: Remco Smits

Committer: GitHub

## Message

```
git_ui: Fix select next/previous entry selects non-visible entry when tree view is enabled (#45030)

Before this commit, we would select a non-visible entry when a directory
is collapsed. Now we correctly select the visible entry that is visually
the previous/next entry in the list.

**Note**: I removed the `cx.notify()` call as it's already part of the
`self.scroll_to_selected_entry(cx)` call. So we don't notify twice :).

Follow-up: https://github.com/zed-industries/zed/pull/45002

**Before**


https://github.com/user-attachments/assets/da0b8084-0081-4d98-ad8a-c11c3b95a1b7

**After**


https://github.com/user-attachments/assets/8a16afb0-fdde-4317-b419-13143d5d608e

Release Notes:

- git_ui: Fix select next/previous entry selects non-visible entry when
tree view is enabled
```

## Parents

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

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