patch 8.2.3591: no event is triggered when closing a window
Problem: No event is triggered when closing a window.
Solution: Add the WinClosed event. (Naohiro Ono, closes #9110)
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 6a4edf9..fdac7da 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -348,6 +348,7 @@
|WinNew| after creating a new window
|TabNew| after creating a new tab page
+|WinClosed| after closing a window
|TabClosed| after closing a tab page
|WinEnter| after entering another window
|WinLeave| before leaving a window
@@ -1280,6 +1281,12 @@
VimSuspend When the Vim instance is suspended. Only when
CTRL-Z was typed inside Vim, not when the
SIGSTOP or SIGTSTP signal was sent to Vim.
+ *WinClosed*
+WinClosed After closing a window. The pattern is
+ matched against the |window-ID|. Both
+ <amatch> and <afile> are set to the
+ |window-ID|. Non-recursive (event cannot
+ trigger itself).
*WinEnter*
WinEnter After entering another window. Not done for
the first window, when Vim has just started.