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

patch 9.0.1538: :wqall does not trigger ExitPre

Problem:    :wqall does not trigger ExitPre. (Bart Libert)
Solution:   Move preparations for :qall to a common function. (closes #12374)
This commit is contained in:
Bram Moolenaar
2023-05-10 16:53:27 +01:00
parent 65b34868da
commit 411da64e77
5 changed files with 37 additions and 6 deletions

View File

@@ -5957,10 +5957,11 @@ ex_cquit(exarg_T *eap UNUSED)
}
/*
* ":qall": try to quit all windows
* Do preparations for "qall" and "wqall".
* Returns FAIL when quitting should be aborted.
*/
static void
ex_quit_all(exarg_T *eap)
int
before_quit_all(exarg_T *eap)
{
if (cmdwin_type != 0)
{
@@ -5968,19 +5969,30 @@ ex_quit_all(exarg_T *eap)
cmdwin_result = K_XF1; // ex_window() takes care of this
else
cmdwin_result = K_XF2;
return;
return FAIL;
}
// Don't quit while editing the command line.
if (text_locked())
{
text_locked_msg();
return;
return FAIL;
}
if (before_quit_autocmds(curwin, TRUE, eap->forceit))
return;
return FAIL;
return OK;
}
/*
* ":qall": try to quit all windows
*/
static void
ex_quit_all(exarg_T *eap)
{
if (before_quit_all(eap) == FAIL)
return;
exiting = TRUE;
if (eap->forceit || !check_changed_any(FALSE, FALSE))
getout(0);