patch 8.1.2044: no easy way to process postponed work
Problem: No easy way to process postponed work. (Paul Jolly)
Solution: Add the SafeState autocommand event.
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index aa28362..d336ba9 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -355,6 +355,9 @@
when popup menu visible
|TextYankPost| after text has been yanked or deleted
+|SafeState| nothing pending, going to wait for the user to type a
+ character
+
|ColorSchemePre| before loading a color scheme
|ColorScheme| after loading a color scheme
@@ -955,6 +958,27 @@
Note that even if an autocommand is defined,
the reply should be read with |remote_read()|
to consume it.
+ *SafeState*
+SafeState When nothing is pending, going to wait for the
+ user to type a character.
+ This will not be triggered when:
+ - an operator is pending
+ - a register was entered with "r
+ - halfway executing a command
+ - executing a mapping
+ - there is typeahead
+ - Insert mode completion is active
+ - Command line completion is active
+ You can use `mode()` to find out what state
+ Vim is in. That may be:
+ - VIsual mode
+ - Normal mode
+ - Insert mode
+ - Command-line mode
+ Depending on what you want to do, you may also
+ check more with `state()`, e.g. whether the
+ screen was scrolled for messages.
+
*SessionLoadPost*
SessionLoadPost After loading the session file created using
the |:mksession| command.