patch 8.1.2195: Vim does not exit when the terminal window is last window
Problem: Vim does not exit when closing a terminal window and it is the
last window.
Solution: Exit Vim if the closed terminal window is the last one.
(closes #4539)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 1d04769..d9fe7de 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -87,7 +87,6 @@
static char_u *repl_cmdline(exarg_T *eap, char_u *src, int srclen, char_u *repl, char_u **cmdlinep);
static void ex_highlight(exarg_T *eap);
static void ex_colorscheme(exarg_T *eap);
-static void ex_quit(exarg_T *eap);
static void ex_cquit(exarg_T *eap);
static void ex_quit_all(exarg_T *eap);
static void ex_close(exarg_T *eap);
@@ -4842,8 +4841,9 @@
/*
* ":quit": quit current window, quit Vim if the last window is closed.
* ":{nr}quit": quit window {nr}
+ * Also used when closing a terminal window that's the last one.
*/
- static void
+ void
ex_quit(exarg_T *eap)
{
win_T *wp;