forked from aniani/vim
patch 8.2.3773: wrong window size when a modeline changes 'columns'
Problem: Wrong window size when a modeline changes 'columns' and there is more than one tabpage. (Michael Soyka) Solution: Adjust the frames of all tabpages. (closes #9315)
This commit is contained in:
@@ -753,6 +753,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3773,
|
||||||
/**/
|
/**/
|
||||||
3772,
|
3772,
|
||||||
/**/
|
/**/
|
||||||
|
37
src/window.c
37
src/window.c
@@ -5353,18 +5353,24 @@ win_free_lsize(win_T *wp)
|
|||||||
void
|
void
|
||||||
shell_new_rows(void)
|
shell_new_rows(void)
|
||||||
{
|
{
|
||||||
int h = (int)ROWS_AVAIL;
|
tabpage_T *tp;
|
||||||
|
|
||||||
if (firstwin == NULL) // not initialized yet
|
if (firstwin == NULL) // not initialized yet
|
||||||
return;
|
return;
|
||||||
if (h < frame_minheight(topframe, NULL))
|
|
||||||
h = frame_minheight(topframe, NULL);
|
|
||||||
|
|
||||||
// First try setting the heights of windows with 'winfixheight'. If
|
FOR_ALL_TABPAGES(tp)
|
||||||
// that doesn't result in the right height, forget about that option.
|
{
|
||||||
frame_new_height(topframe, h, FALSE, TRUE);
|
int h = (int)ROWS_AVAIL;
|
||||||
if (!frame_check_height(topframe, h))
|
|
||||||
frame_new_height(topframe, h, FALSE, FALSE);
|
if (h < frame_minheight(tp->tp_topframe, NULL))
|
||||||
|
h = frame_minheight(tp->tp_topframe, NULL);
|
||||||
|
|
||||||
|
// First try setting the heights of windows with 'winfixheight'. If
|
||||||
|
// that doesn't result in the right height, forget about that option.
|
||||||
|
frame_new_height(tp->tp_topframe, h, FALSE, TRUE);
|
||||||
|
if (!frame_check_height(tp->tp_topframe, h))
|
||||||
|
frame_new_height(tp->tp_topframe, h, FALSE, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
(void)win_comp_pos(); // recompute w_winrow and w_wincol
|
(void)win_comp_pos(); // recompute w_winrow and w_wincol
|
||||||
compute_cmdrow();
|
compute_cmdrow();
|
||||||
@@ -5383,14 +5389,19 @@ shell_new_rows(void)
|
|||||||
void
|
void
|
||||||
shell_new_columns(void)
|
shell_new_columns(void)
|
||||||
{
|
{
|
||||||
|
tabpage_T *tp;
|
||||||
|
|
||||||
if (firstwin == NULL) // not initialized yet
|
if (firstwin == NULL) // not initialized yet
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// First try setting the widths of windows with 'winfixwidth'. If that
|
FOR_ALL_TABPAGES(tp)
|
||||||
// doesn't result in the right width, forget about that option.
|
{
|
||||||
frame_new_width(topframe, (int)Columns, FALSE, TRUE);
|
// First try setting the widths of windows with 'winfixwidth'. If that
|
||||||
if (!frame_check_width(topframe, Columns))
|
// doesn't result in the right width, forget about that option.
|
||||||
frame_new_width(topframe, (int)Columns, FALSE, FALSE);
|
frame_new_width(tp->tp_topframe, (int)Columns, FALSE, TRUE);
|
||||||
|
if (!frame_check_width(tp->tp_topframe, Columns))
|
||||||
|
frame_new_width(tp->tp_topframe, (int)Columns, FALSE, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
(void)win_comp_pos(); // recompute w_winrow and w_wincol
|
(void)win_comp_pos(); // recompute w_winrow and w_wincol
|
||||||
#if 0
|
#if 0
|
||||||
|
Reference in New Issue
Block a user