Skip to content

Commit d326ad6

Browse files
committed
patch 8.0.1125: wrong window height when splitting window with window toolbar
Problem: Wrong window height when splitting window with window toolbar. Solution: Add or subtract the window toolbar height.
1 parent f16c71b commit d326ad6

2 files changed

Lines changed: 27 additions & 5 deletions

File tree

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1125,
764766
/**/
765767
1124,
766768
/**/

src/window.c

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,14 +1098,22 @@ win_split_ins(
10981098
{
10991099
/* set height and row of new window to full height */
11001100
wp->w_winrow = tabline_height();
1101-
win_new_height(wp, curfrp->fr_height - (p_ls > 0));
1101+
win_new_height(wp, curfrp->fr_height - (p_ls > 0)
1102+
#ifdef FEAT_MENU
1103+
- wp->w_winbar_height
1104+
#endif
1105+
);
11021106
wp->w_status_height = (p_ls > 0);
11031107
}
11041108
else
11051109
{
11061110
/* height and row of new window is same as current window */
11071111
wp->w_winrow = oldwin->w_winrow;
1108-
win_new_height(wp, oldwin->w_height);
1112+
win_new_height(wp, oldwin->w_height
1113+
#ifdef FEAT_MENU
1114+
+ oldwin->w_winbar_height
1115+
#endif
1116+
);
11091117
wp->w_status_height = oldwin->w_status_height;
11101118
}
11111119
frp->fr_height = curfrp->fr_height;
@@ -1163,7 +1171,11 @@ win_split_ins(
11631171
win_new_height(wp, new_size);
11641172
if (flags & (WSP_TOP | WSP_BOT))
11651173
{
1166-
int new_fr_height = curfrp->fr_height - new_size;
1174+
int new_fr_height = curfrp->fr_height - new_size
1175+
#ifdef FEAT_MENU
1176+
+ wp->w_winbar_height
1177+
#endif
1178+
;
11671179

11681180
if (!((flags & WSP_BOT) && p_ls == 0))
11691181
new_fr_height -= STATUS_HEIGHT;
@@ -2855,7 +2867,11 @@ frame_new_height(
28552867
{
28562868
/* Simple case: just one window. */
28572869
win_new_height(topfrp->fr_win,
2858-
height - topfrp->fr_win->w_status_height);
2870+
height - topfrp->fr_win->w_status_height
2871+
#ifdef FEAT_MENU
2872+
- topfrp->fr_win->w_winbar_height
2873+
#endif
2874+
);
28592875
}
28602876
else if (topfrp->fr_layout == FR_ROW)
28612877
{
@@ -3201,7 +3217,11 @@ frame_fix_width(win_T *wp)
32013217
static void
32023218
frame_fix_height(win_T *wp)
32033219
{
3204-
wp->w_frame->fr_height = wp->w_height + wp->w_status_height;
3220+
wp->w_frame->fr_height = wp->w_height + wp->w_status_height
3221+
#ifdef FEAT_MENU
3222+
+ wp->w_winbar_height
3223+
#endif
3224+
;
32053225
}
32063226

32073227
/*

0 commit comments

Comments
 (0)