summaryrefslogtreecommitdiffstats
path: root/runtime/doc/autocmd.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-11-22 12:40:50 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-22 12:40:50 +0000
commit35fc61cb5b5eba8bbb9d8f0700332fbab38f40ca (patch)
tree352599f641e6c8c88d8574871f8b8e86b6168dba /runtime/doc/autocmd.txt
parentce30ccc06af7f2c03762e5b18dde37b26ea6ec42 (diff)
patch 9.0.0917: the WinScrolled autocommand event is not enoughv9.0.0917
Problem: The WinScrolled autocommand event is not enough. Solution: Add WinResized and provide information about what changed. (closes #11576)
Diffstat (limited to 'runtime/doc/autocmd.txt')
-rw-r--r--runtime/doc/autocmd.txt33
1 files changed, 21 insertions, 12 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 86ae60f67d..fbd0b0df37 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1371,21 +1371,24 @@ WinNew When a new window was created. Not done for
Before a WinEnter event.
*WinScrolled*
-WinScrolled After scrolling the content of a window or
- resizing a window in the current tab page.
-
- When more than one window scrolled or resized
- only one WinScrolled event is triggered. You
- can use the `winlayout()` and `getwininfo()`
- functions to see what changed.
+WinScrolled After any window in the current tab page
+ scrolled the text (horizontally or vertically)
+ or changed width or height. See
+ |win-scrolled-resized|.
The pattern is matched against the |window-ID|
of the first window that scrolled or resized.
Both <amatch> and <afile> are set to the
|window-ID|.
+ |v:event| is set with information about size
+ and scroll changes. |WinScrolled-event|
+
Only starts triggering after startup finished
and the first screen redraw was done.
+ Does not trigger when defining the first
+ WinScrolled or WinResized event, but may
+ trigger when adding more.
Non-recursive: the event will not trigger
while executing commands for the WinScrolled
@@ -1393,11 +1396,17 @@ WinScrolled After scrolling the content of a window or
window to scroll or change size, then another
WinScrolled event will be triggered later.
- Does not trigger when the command is added,
- only after the first scroll or resize.
- *E1312*
- It is not allowed to change the window layout
- here (split, close or move windows).
+
+ *WinResized*
+WinResized After a window in the current tab page changed
+ width or height.
+ See |win-scrolled-resized|.
+
+ |v:event| is set with information about size
+ changes. |WinResized-event|
+
+ Same behavior as |WinScrolled| for the
+ pattern, triggering and recursiveness.
==============================================================================
6. Patterns *autocmd-patterns* *{aupat}*