Problem: crash with WinNewPre autocommand

Problem:  crash with WinNewPre autocommand, because window
          structures are not yet safe to use
Solution: Don't trigger WinNewPre on :tabnew

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2024-08-11 20:09:17 +02:00
parent e20aeb875c
commit fb3f969936
6 changed files with 66 additions and 20 deletions

View File

@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 9.1. Last change: 2024 Jul 17
*autocmd.txt* For Vim version 9.1. Last change: 2024 Aug 10
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1427,8 +1427,10 @@ WinLeave Before leaving a window. If the window to be
*WinNewPre*
WinNewPre Before creating a new window. Triggered
before commands that modify window layout by
creating a split or new tab page. Not done for
the first window, when Vim has just started.
creating a split.
Not done for creating tabs or for the first
window, as the window structure is not
initialized yet and so is generally not safe.
It is not allowed to modify window layout
while executing commands for the WinNewPre
event.