vim-patch:8.2.2898: QuitPre and ExitPre not triggered when GUI window is closed

Problem:    QuitPre and ExitPre not triggered when GUI window is closed.
Solution:   Call before_quit_autocmds(). (closes vim/vim#8242)
3552e74289
This commit is contained in:
Jan Edmund Lazo
2021-05-29 09:53:33 -04:00
parent 43956dea55
commit 30a34136b6

View File

@@ -6340,7 +6340,7 @@ void not_exiting(void)
exiting = false; exiting = false;
} }
static bool before_quit_autocmds(win_T *wp, bool quit_all, int forceit) bool before_quit_autocmds(win_T *wp, bool quit_all, int forceit)
{ {
apply_autocmds(EVENT_QUITPRE, NULL, NULL, false, wp->w_buffer); apply_autocmds(EVENT_QUITPRE, NULL, NULL, false, wp->w_buffer);
@@ -6406,7 +6406,7 @@ static void ex_quit(exarg_T *eap)
return; return;
} }
// If there are more files or windows we won't exit. // If there is only one relevant window we will exit.
if (check_more(false, eap->forceit) == OK && only_one_window()) { if (check_more(false, eap->forceit) == OK && only_one_window()) {
exiting = true; exiting = true;
} }