mirror of
https://github.com/neovim/neovim.git
synced 2025-09-15 15:58:17 +00:00
terminal: handle &confirm and :confirm on unloading (#8726)
Show a proper confirmation dialog when trying to unload a terminal buffer while the confirm option is set or when :confirm is used. Fixes https://github.com/neovim/neovim/issues/4651
This commit is contained in:
@@ -1172,14 +1172,21 @@ do_buffer (
|
||||
}
|
||||
} else {
|
||||
if (buf->terminal) {
|
||||
EMSG2(_("E89: %s will be killed(add ! to override)"),
|
||||
(char *)buf->b_fname);
|
||||
if (p_confirm || cmdmod.confirm) {
|
||||
if (!dialog_close_terminal(buf)) {
|
||||
return FAIL;
|
||||
}
|
||||
} else {
|
||||
EMSG2(_("E89: %s will be killed(add ! to override)"),
|
||||
(char *)buf->b_fname);
|
||||
return FAIL;
|
||||
}
|
||||
} else {
|
||||
EMSGN(_("E89: No write since last change for buffer %" PRId64
|
||||
" (add ! to override)"),
|
||||
buf->b_fnum);
|
||||
return FAIL;
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user