call StopVimInTerminal(buf)
endfunc
+" When showtabpanel=1 and a second tab is opened, all existing tab pages must
+" have their frame width updated, not just the newly created one.
+function Test_tabpanel_showtabpanel_via_cmd_arg()
+ let tpl_width = 20 " default tpl_columns
+ set showtabpanel=1 noruler
+
+ " With one tab the tabpanel is hidden; no width reduction yet.
+ tabfirst
+ call assert_equal(&columns, winwidth(0))
+
+ " Opening a second tab makes the tabpanel visible; the first tab page must
+ " also get its frame width reduced.
+ tabnew
+ tabfirst
+ call assert_equal(&columns - tpl_width, winwidth(0),
+ \ 'first tab width after tabnew')
+ call assert_equal(tpl_width + 1, win_screenpos(0)[1],
+ \ 'first tab wincol after tabnew')
+
+ tabonly
+ set showtabpanel& noruler&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
#endif
#if defined(FEAT_TABPANEL)
if (prev_columns != COLUMNS_WITHOUT_TPL())
+ {
+ tabpage_T *tp2;
+ int w = COLUMNS_WITHOUT_TPL();
+
shell_new_columns();
+ // shell_new_columns() only updates the current tab page; fix up
+ // all others.
+ FOR_ALL_TABPAGES(tp2)
+ if (tp2 != curtab)
+ {
+ frame_new_width(tp2->tp_topframe, w, FALSE, TRUE);
+ if (!frame_check_width(tp2->tp_topframe, w))
+ frame_new_width(tp2->tp_topframe, w, FALSE, FALSE);
+ }
+ }
#endif
redraw_all_later(UPD_NOT_VALID);
apply_autocmds(EVENT_WINNEW, NULL, NULL, FALSE, curbuf);