summaryrefslogtreecommitdiffstats
path: root/runtime/doc/autocmd.txt
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2022-04-08 15:18:45 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-08 15:18:45 +0100
commit0937182d49fa8db50cec42785f22f1031760a0bd (patch)
treea41ab36fcbeb5b2f0bc91ce36b2d056af2ec2491 /runtime/doc/autocmd.txt
parent18ee0f603ebd3c091f6d2ab88e652fda32821048 (diff)
patch 8.2.4713: plugins cannot track text scrollingv8.2.4713
Problem: Plugins cannot track text scrolling. Solution: Add the WinScrolled event. (closes #10102)
Diffstat (limited to 'runtime/doc/autocmd.txt')
-rw-r--r--runtime/doc/autocmd.txt25
1 files changed, 23 insertions, 2 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 16bbbf5807..beb1f2e3ad 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -402,6 +402,8 @@ Name triggered by ~
|User| to be used in combination with ":doautocmd"
|SigUSR1| after the SIGUSR1 signal has been detected
+|WinScrolled| after scrolling or resizing a window
+
The alphabetical list of autocommand events: *autocmd-events-abc*
@@ -1228,7 +1230,13 @@ User Never executed automatically. To be used for
Note that when `:doautocmd User MyEvent` is
used while there are no matching autocommands,
you will get an error. If you don't want
- that, define a dummy autocommand yourself.
+ that, either check whether an autocommand is
+ defined using `exists('#User#MyEvent')` or
+ define a dummy autocommand yourself.
+ Example: >
+ if exists('#User#MyEvent')
+ doautocmd User MyEvent
+ endif
*SigUSR1*
SigUSR1 After the SIGUSR1 signal has been detected.
@@ -1317,10 +1325,23 @@ WinNew When a new window was created. Not done for
the first window, when Vim has just started.
Before a WinEnter event.
+ *WinScrolled*
+WinScrolled After scrolling the content of a window or
+ resizing a window.
+ The pattern is matched against the
+ |window-ID|. Both <amatch> and <afile> are
+ set to the |window-ID|.
+ Non-recursive (the event cannot trigger
+ itself). However, if the command causes the
+ window to scroll or change size another
+ WinScrolled event will be triggered later.
+ Does not trigger when the command is added,
+ only after the first scroll or resize.
+
==============================================================================
6. Patterns *autocmd-patterns* *{aupat}*
-The {aupat} argument of `:autocmd` can be a comma separated list. This works as
+The {aupat} argument of `:autocmd` can be a comma-separated list. This works as
if the command was given with each pattern separately. Thus this command: >
:autocmd BufRead *.txt,*.info set et
Is equivalent to: >