Mercurial > vim
diff runtime/doc/autocmd.txt @ 31166:a86ee6c0309e v9.0.0917
patch 9.0.0917: the WinScrolled autocommand event is not enough
Commit: https://github.com/vim/vim/commit/35fc61cb5b5eba8bbb9d8f0700332fbab38f40ca
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Nov 22 12:40:50 2022 +0000
patch 9.0.0917: the WinScrolled autocommand event is not enough
Problem: The WinScrolled autocommand event is not enough.
Solution: Add WinResized and provide information about what changed.
(closes #11576)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 22 Nov 2022 13:45:04 +0100 |
parents | 514ab6bdf73d |
children | a7801222c9c5 |
line wrap: on
line diff
--- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1371,21 +1371,24 @@ WinNew When a new window was created. 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 conten 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}*