comparison src/ex_docmd.c @ 24719:4ae10e6c3a9c v8.2.2898

patch 8.2.2898: QuitPre and ExitPre not triggered when GUI window is closed Commit: https://github.com/vim/vim/commit/3552e742898cd57adaf9b8ce32a9056271eab8d2 Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 29 12:21:58 2021 +0200 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 https://github.com/vim/vim/issues/8242)
author Bram Moolenaar <Bram@vim.org>
date Sat, 29 May 2021 12:30:04 +0200
parents b19c8150ee9d
children 5194fba32954
comparison
equal deleted inserted replaced
24718:998269fb087b 24719:4ae10e6c3a9c
5496 { 5496 {
5497 exiting = FALSE; 5497 exiting = FALSE;
5498 settmode(TMODE_RAW); 5498 settmode(TMODE_RAW);
5499 } 5499 }
5500 5500
5501 static int 5501 int
5502 before_quit_autocmds(win_T *wp, int quit_all, int forceit) 5502 before_quit_autocmds(win_T *wp, int quit_all, int forceit)
5503 { 5503 {
5504 apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, wp->w_buffer); 5504 apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, wp->w_buffer);
5505 5505
5506 // Bail out when autocommands closed the window. 5506 // Bail out when autocommands closed the window.
5570 #ifdef FEAT_NETBEANS_INTG 5570 #ifdef FEAT_NETBEANS_INTG
5571 netbeansForcedQuit = eap->forceit; 5571 netbeansForcedQuit = eap->forceit;
5572 #endif 5572 #endif
5573 5573
5574 /* 5574 /*
5575 * If there are more files or windows we won't exit. 5575 * If there is only one relevant window we will exit.
5576 */ 5576 */
5577 if (check_more(FALSE, eap->forceit) == OK && only_one_window()) 5577 if (check_more(FALSE, eap->forceit) == OK && only_one_window())
5578 exiting = TRUE; 5578 exiting = TRUE;
5579 if ((!buf_hide(wp->w_buffer) 5579 if ((!buf_hide(wp->w_buffer)
5580 && check_changed(wp->w_buffer, (p_awa ? CCGD_AW : 0) 5580 && check_changed(wp->w_buffer, (p_awa ? CCGD_AW : 0)