diff runtime/doc/autocmd.txt @ 18098:a2870e6f5b45 v8.1.2044

patch 8.1.2044: no easy way to process postponed work Commit: https://github.com/vim/vim/commit/8aeec40207b5adcd3a155277dc4f29189343b963 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 15 23:02:04 2019 +0200 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.
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Sep 2019 23:15:03 +0200
parents 5a0d5f8e1778
children 0d9ec3a2821f
line wrap: on
line diff
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -355,6 +355,9 @@ Name			triggered by ~
 			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 @@ RemoteReply			When a reply from a Vim th
 				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.