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 #8242)
diff --git a/src/gui.c b/src/gui.c
index c0374c5..2539a4f 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -857,9 +857,10 @@
void
gui_shell_closed(void)
{
- cmdmod_T save_cmdmod;
+ cmdmod_T save_cmdmod = cmdmod;
- save_cmdmod = cmdmod;
+ if (before_quit_autocmds(curwin, TRUE, FALSE))
+ return;
// Only exit when there are no changed files
exiting = TRUE;