0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.0708: :confirm does not work properly for a terminal buffer

Problem:    :confirm does not work properly for a terminal buffer.
Solution:   Handle :confirm for a terminal buffer differently.  (Yee Cheng
            Chin, closes #11312)
This commit is contained in:
Yee Cheng Chin
2022-10-09 18:53:32 +01:00
committed by Bram Moolenaar
parent 118c235112
commit 15b314ffbb
8 changed files with 242 additions and 36 deletions

View File

@@ -6061,13 +6061,27 @@ ex_win_close(
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write)
{
bufref_T bufref;
# ifdef FEAT_TERMINAL
if (term_job_running(buf->b_term))
{
if (term_confirm_stop(buf) == FAIL)
return;
// Manually kill the terminal here because this command will
// hide it otherwise.
free_terminal(buf);
need_hide = FALSE;
}
else
# endif
{
bufref_T bufref;
set_bufref(&bufref, buf);
dialog_changed(buf, FALSE);
if (bufref_valid(&bufref) && bufIsChanged(buf))
return;
need_hide = FALSE;
set_bufref(&bufref, buf);
dialog_changed(buf, FALSE);
if (bufref_valid(&bufref) && bufIsChanged(buf))
return;
need_hide = FALSE;
}
}
else
#endif