# vim: Fix :wq in multibuffer \(\#24603\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 2f741c86864f1d9670e3cb01a05c1cbfe5395581

Requested commit: 2f741c86864f1d9670e3cb01a05c1cbfe5395581

Commit: 2f741c86864f1d9670e3cb01a05c1cbfe5395581

Tree: ad5032243b52ea625266fad72222301ce4c4e761

Author: Conrad Irwin

Committer: GitHub

## Message

```
vim: Fix :wq in multibuffer (#24603)

Supercedes #24561
Closes #21059

Before this change we would skip saving multibuffers regardless of the
save intent. Now we correctly save them.

Along the way:
* Prompt to save when closing the last singleton copy of an item (even
if it's still open in a multibuffer).
* Update our file name prompt to pull out dirty project items from
multibuffers instead of counting multibuffers as untitled files.
* Fix our prompt test helpers to require passing the button name instead
of the index. A few tests were passing invalid responses to save
prompts.
* Refactor the code a bit to hopefully clarify it for the next bug.

Release Notes:

- Fixed edge-cases when closing multiple items including multibuffers.
Previously no prompt was generated when closing an item that was open in
a multibuffer, now you will be prompted.
- vim: Fix :wq in a multibuffer
```

## Parents

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

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