Files
zed/crates/tab_switcher
Parker Loflin 05c93905c5 workspace: Close multibuffers without closing their files (#67383)
## Summary

`:bd` in a multibuffer also closes the tab for the file under the
cursor. Closing by path treats a multi-file item as the file under its
cursor, so the reverse happens too: `:bd` in a file closes a multibuffer
with its cursor in that file. The tab switcher has the same bug.

Closing by path now matches only single-file items. `:bd` and the tab
switcher close other items by ID. As a result, tabs for files that
failed to open now close individually.

Closes #61985

## Testing

- `test_close_by_path_keeps_multibuffers_and_files_apart` fails if any
of the three changes is reverted.
- `cargo test -p tab_switcher -p workspace -p vim --lib` and
`./script/clippy -p workspace -p tab_switcher` pass.
- In Zed with rust-analyzer, `:bd` in References, `:bd` in a file with
References open, and closing References from the tab switcher each close
an extra tab on `main` and only their target on this branch.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- Fixed `workspace: close item in all panes` (and `:bd[elete]` in Vim
mode) also closing the tabs of the file under the cursor in a
multibuffer.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-11-24 16:07:30 +00:00
..