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

Make :confirm bd work for terminal buffers #4651

Closed
blueyed opened this issue Apr 26, 2016 · 1 comment
Closed

Make :confirm bd work for terminal buffers #4651

blueyed opened this issue Apr 26, 2016 · 1 comment
Assignees
Labels
bug issues reporting wrong behavior terminal built-in :terminal or :shell
Milestone

Comments

@blueyed
Copy link
Contributor

blueyed commented Apr 26, 2016

It would be nice if :confirm bd would work as with a changed buffer: it should ask for confirmation instead of requiring you to use :bd!:

E89: term://.//15810:… will be killed(add ! to override)

Relevant code:

neovim/src/nvim/buffer.c

Lines 953 to 975 in ef205c3

if (!forceit && (buf->terminal || bufIsChanged(buf))) {
if ((p_confirm || cmdmod.confirm) && p_write && !buf->terminal) {
dialog_changed(buf, FALSE);
if (!buf_valid(buf))
/* Autocommand deleted buffer, oops! It's not changed
* now. */
return FAIL;
/* If it's still changed fail silently, the dialog already
* mentioned why it fails. */
if (bufIsChanged(buf))
return FAIL;
} else {
if (buf->terminal) {
EMSG2(_("E89: %s will be killed(add ! to override)"),
(char *)buf->b_fname);
} else {
EMSGN(_("E89: No write since last change for buffer %" PRId64
" (add ! to override)"),
buf->b_fnum);
}
return FAIL;
}
}
.

Here !buf->terminal is checked for in the block that uses the dialog.
I think there could be a new dialog_terminal_kill for this.

  • Neovim version: v0.1.5-24-gef205c3
@justinmk justinmk added the bug issues reporting wrong behavior label Apr 26, 2016
@justinmk justinmk added this to the todo milestone Apr 26, 2016
@justinmk justinmk added the terminal built-in :terminal or :shell label Apr 26, 2016
@Asheq
Copy link

Asheq commented Jul 10, 2018

Also, I think that if the confirm option is set, :bd should behave the same as :confirm bd

mhinz added a commit to mhinz/neovim that referenced this issue Jul 11, 2018
Show a proper confirmation dialog when trying to unload a terminal buffer while
the confirm option is set or when :confirm is used.

Fixes neovim#4651
mhinz added a commit to mhinz/neovim that referenced this issue Jul 11, 2018
Show a proper confirmation dialog when trying to unload a terminal buffer while
the confirm option is set or when :confirm is used.

Fixes neovim#4651
mhinz added a commit to mhinz/neovim that referenced this issue Jul 11, 2018
Show a proper confirmation dialog when trying to unload a terminal buffer while
the confirm option is set or when :confirm is used.

Fixes neovim#4651
mhinz added a commit to mhinz/neovim that referenced this issue Jul 11, 2018
Show a proper confirmation dialog when trying to unload a terminal buffer while
the confirm option is set or when :confirm is used.

Fixes neovim#4651
mhinz added a commit that referenced this issue Jul 12, 2018
Show a proper confirmation dialog when trying to unload a terminal buffer while
the confirm option is set or when :confirm is used.

Fixes #4651
coditva pushed a commit to coditva/neovim that referenced this issue Jul 28, 2018
Show a proper confirmation dialog when trying to unload a terminal buffer while
the confirm option is set or when :confirm is used.

Fixes neovim#4651
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior terminal built-in :terminal or :shell
Projects
None yet
Development

No branches or pull requests

4 participants