diff src/ex_docmd.c @ 21016:0738c44504cb v8.2.1059

patch 8.2.1059: crash when using :tabonly in an autocommand Commit: https://github.com/vim/vim/commit/cf8441704d6e517bda1899f4afa82c6b4eecbaec Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jun 26 19:44:06 2020 +0200 patch 8.2.1059: crash when using :tabonly in an autocommand Problem: Crash when using :tabonly in an autocommand. (Yegappan Lakshmanan) Solution: Do not allow the autocommand window to be closed.
author Bram Moolenaar <Bram@vim.org>
date Fri, 26 Jun 2020 19:45:07 +0200
parents 3af71cbcfdbe
children a7c202f5cbe9
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -5178,6 +5178,13 @@ ex_win_close(
     int		need_hide;
     buf_T	*buf = win->w_buffer;
 
+    // Never close the autocommand window.
+    if (win == aucmd_win)
+    {
+	emsg(_(e_autocmd_close));
+	return;
+    }
+
     need_hide = (bufIsChanged(buf) && buf->b_nwindows <= 1);
     if (need_hide && !buf_hide(buf) && !forceit)
     {