vim-patch:8.2.0137: crash when using win_execute() from a new tab

Problem:    Crash when using win_execute() from a new tab.
Solution:   Set the tp_*win pointers. (Ozaki Kiichi, closes vim/vim#5512)
a44b3eeafa
This commit is contained in:
jing
2021-05-01 10:38:43 +08:00
parent ec3524da29
commit 8fecc5fab8
2 changed files with 17 additions and 2 deletions

View File

@@ -3459,6 +3459,9 @@ int win_alloc_first(void)
first_tabpage = alloc_tabpage();
first_tabpage->tp_topframe = topframe;
curtab = first_tabpage;
curtab->tp_firstwin = firstwin;
curtab->tp_lastwin = lastwin;
curtab->tp_curwin = curwin;
return OK;
}
@@ -3627,6 +3630,8 @@ int win_new_tabpage(int after, char_u *filename)
newtp->tp_next = tp->tp_next;
tp->tp_next = newtp;
}
newtp->tp_firstwin = newtp->tp_lastwin = newtp->tp_curwin = curwin;
win_init_size();
firstwin->w_winrow = tabline_height();
win_comp_scroll(curwin);