Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bufdelete): added an option to cancel closing multiple buffers with bufdelete #1514

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

acidclouds
Copy link
Contributor

Description

When using bufdelete close all on multiple unsaved buffers, and choosing cancel when the prompt shows up, bufdelete continues to try to close the following buffers as well.
This behavior is a little strange, if I would want to save the buffer, I would have chosen yes, if I wanted to discard the changes, I would have chosen no. If I chose cancel/Ctrl-C the logical thing would be cancel the whole bulk operation and let the user perform any modifications they might deem necessary before proceeding.

This would allow a user to define an autocommand on PreExit to call bufdelete all and get a prompt for each unsaved buffer, deciding if he would like to save the changes or not, and also allowing to cancel the whole operation and stop nvim from exiting. This behavior is the normal behavior in numerous application including office applications preventing unintentional data loss.

This PR provides the described desired functionality

Related Issue(s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: allow cancelling of bufdelete closing of multiple buffers
1 participant