0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 9.0.0965: using one window for executing autocommands is insufficient

Problem:    Using one window for executing autocommands is insufficient.
Solution:   Use up to five windows for executing autocommands.
This commit is contained in:
Bram Moolenaar
2022-11-28 18:51:43 +00:00
parent 74a694dbe2
commit e76062c078
28 changed files with 451 additions and 260 deletions

View File

@@ -3560,15 +3560,18 @@ term_after_channel_closed(term_T *term)
// ++close or term_finish == "close"
ch_log(NULL, "terminal job finished, closing window");
aucmd_prepbuf(&aco, term->tl_buffer);
// Avoid closing the window if we temporarily use it.
if (curwin == aucmd_win)
do_set_w_closing = TRUE;
if (do_set_w_closing)
curwin->w_closing = TRUE;
do_bufdel(DOBUF_WIPE, (char_u *)"", 1, fnum, fnum, FALSE);
if (do_set_w_closing)
curwin->w_closing = FALSE;
aucmd_restbuf(&aco);
if (curbuf == term->tl_buffer)
{
// Avoid closing the window if we temporarily use it.
if (is_aucmd_win(curwin))
do_set_w_closing = TRUE;
if (do_set_w_closing)
curwin->w_closing = TRUE;
do_bufdel(DOBUF_WIPE, (char_u *)"", 1, fnum, fnum, FALSE);
if (do_set_w_closing)
curwin->w_closing = FALSE;
aucmd_restbuf(&aco);
}
#ifdef FEAT_PROP_POPUP
if (pwin != NULL)
popup_close_with_retval(pwin, 0);