# Fix CloseProject not switching to neighbor in multi-project workspace \(\#60524\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 5471ee3f8bcab9586d48a695546cebea81933a2f

Requested commit: 5471ee3f8bcab9586d48a695546cebea81933a2f

Commit: 5471ee3f8bcab9586d48a695546cebea81933a2f

Tree: 0f6637ecff8e3ca1897271d72a2f547d5434ddba

Author: Akshit Joshi

Committer: GitHub

## Message

```
Fix CloseProject not switching to neighbor in multi-project workspace (#60524)

Fixes #54772

When "Workspace: close project" was used in a multi-project window, the
handler pre-created an empty "get started" workspace and activated it
before removing the old project group. This prevented
`remove_project_group` from detecting that the active workspace was
being removed, so the neighbor-fallback never ran — leaving the user on
the empty workspace even though other projects were still open.

The fix delegates entirely to `remove_project_group`, which already
handles:
- Computing a neighboring project group
- Prompting for unsaved changes via `prepare_to_close`
- Activating the neighbor (or creating an empty workspace if none
remains)

This matches the behavior of the sidebar "Remove Project" action, which
uses the same `remove_project_group` path.

Release Notes:

- Fixed "Workspace: close project" action not switching to another
project in multi-project workspace

---------

Co-authored-by: Eric Holk <eric@zed.dev>
```

## Parents

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

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