1
0
forked from aniani/vim

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

@@ -4607,6 +4607,11 @@ free_tabpage(tabpage_T *tp)
* It will edit the current buffer, like after ":split".
* When "after" is 0 put it just after the current Tab page.
* Otherwise put it just before tab page "after".
*
* Does not trigger WinNewPre, since the window structures
* are not completly setup yet and could cause dereferencing
* NULL pointers
*
* Return FAIL or OK.
*/
int
@@ -4640,8 +4645,6 @@ win_new_tabpage(int after)
newtp->tp_localdir = (tp->tp_localdir == NULL)
? NULL : vim_strsave(tp->tp_localdir);
trigger_winnewpre();
// Create a new empty window.
if (win_alloc_firstwin(tp->tp_curwin) == OK)
{