# Prevent folder expansion when all items are closed \(\#12729\) · gitcafe/zed

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

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

Visibility: public

Requested revision: fd39f20842967f0fb8a6c508bc2e1ebaefbaf15f

Requested commit: fd39f20842967f0fb8a6c508bc2e1ebaefbaf15f

Commit: fd39f20842967f0fb8a6c508bc2e1ebaefbaf15f

Tree: bc62f5bebb902434875211aef3cda0eec20d8fc6

Author: Panghu

Committer: GitHub

## Message

```
Prevent folder expansion when all items are closed (#12729)

Release Notes:

- Prevent folder expansion when all items are closed

### Problem
When all items are closed, the next activated file expands (see the
video below).


https://github.com/zed-industries/zed/assets/21101490/a7631cd2-4e97-4954-8b01-d283dd4796be


### Cause
When the currently active item is closed, Zed tries to activate the
previously active item. Activating an item by default expands the
corresponding folder, which can result in folders being expanded when
all files are closed.

### Fixed Video


https://github.com/zed-industries/zed/assets/21101490/d30f05c5-6d86-4e11-b349-337fa75586f3
```

## Parents

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

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