patch 8.0.1595: no autocommand triggered before exiting
Problem: No autocommand triggered before exiting.
Solution: Add the ExitPre autocommand event.
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 7c547df..e08a7cb 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -285,7 +285,8 @@
|GUIFailed| after starting the GUI failed
|TermResponse| after the terminal response to |t_RV| is received
-|QuitPre| when using `:quit`, before deciding whether to quit
+|QuitPre| when using `:quit`, before deciding whether to exit
+|ExitPre| when using a command that may make Vim exit
|VimLeavePre| before exiting Vim, before writing the viminfo file
|VimLeave| before exiting Vim, after writing the viminfo file
@@ -651,6 +652,11 @@
"auto" to trigger on 'autochdir'.
"drop" to trigger on editing a file
<afile> is set to the new directory name.
+ *ExitPre*
+ExitPre When using `:quit`, `:wq` in a way it makes
+ Vim exit, or using `:qall`, just after
+ |QuitPre|. Can be used to close any
+ non-essential window.
*FileChangedShell*
FileChangedShell When Vim notices that the modification time of
a file has changed since editing started.
@@ -866,6 +872,7 @@
or quits Vim. Can be used to close any
non-essential window if the current window is
the last ordinary window.
+ Also see |ExitPre|.
*RemoteReply*
RemoteReply When a reply from a Vim that functions as
server was received |server2client()|. The