comparison src/window.c @ 12491:7ab796b041bd v8.0.1125

patch 8.0.1125: wrong window height when splitting window with window toolbar commit https://github.com/vim/vim/commit/d326ad6e93604222c64bae51f47521fe9114d1ea Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 18 20:31:41 2017 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Mon, 18 Sep 2017 20:45:04 +0200
parents 3f16cf18386c
children 3ca08bf99396
comparison
equal deleted inserted replaced
12490:8b61d4462700 12491:7ab796b041bd
1096 } 1096 }
1097 if (flags & (WSP_TOP | WSP_BOT)) 1097 if (flags & (WSP_TOP | WSP_BOT))
1098 { 1098 {
1099 /* set height and row of new window to full height */ 1099 /* set height and row of new window to full height */
1100 wp->w_winrow = tabline_height(); 1100 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 );
1102 wp->w_status_height = (p_ls > 0); 1106 wp->w_status_height = (p_ls > 0);
1103 } 1107 }
1104 else 1108 else
1105 { 1109 {
1106 /* height and row of new window is same as current window */ 1110 /* height and row of new window is same as current window */
1107 wp->w_winrow = oldwin->w_winrow; 1111 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 );
1109 wp->w_status_height = oldwin->w_status_height; 1117 wp->w_status_height = oldwin->w_status_height;
1110 } 1118 }
1111 frp->fr_height = curfrp->fr_height; 1119 frp->fr_height = curfrp->fr_height;
1112 1120
1113 /* "new_size" of the current window goes to the new window, use 1121 /* "new_size" of the current window goes to the new window, use
1161 /* "new_size" of the current window goes to the new window, use 1169 /* "new_size" of the current window goes to the new window, use
1162 * one row for the status line */ 1170 * one row for the status line */
1163 win_new_height(wp, new_size); 1171 win_new_height(wp, new_size);
1164 if (flags & (WSP_TOP | WSP_BOT)) 1172 if (flags & (WSP_TOP | WSP_BOT))
1165 { 1173 {
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 ;
1167 1179
1168 if (!((flags & WSP_BOT) && p_ls == 0)) 1180 if (!((flags & WSP_BOT) && p_ls == 0))
1169 new_fr_height -= STATUS_HEIGHT; 1181 new_fr_height -= STATUS_HEIGHT;
1170 frame_new_height(curfrp, new_fr_height, flags & WSP_TOP, FALSE); 1182 frame_new_height(curfrp, new_fr_height, flags & WSP_TOP, FALSE);
1171 } 1183 }
2853 2865
2854 if (topfrp->fr_win != NULL) 2866 if (topfrp->fr_win != NULL)
2855 { 2867 {
2856 /* Simple case: just one window. */ 2868 /* Simple case: just one window. */
2857 win_new_height(topfrp->fr_win, 2869 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 );
2859 } 2875 }
2860 else if (topfrp->fr_layout == FR_ROW) 2876 else if (topfrp->fr_layout == FR_ROW)
2861 { 2877 {
2862 do 2878 do
2863 { 2879 {
3199 * Set frame height from the window it contains. 3215 * Set frame height from the window it contains.
3200 */ 3216 */
3201 static void 3217 static void
3202 frame_fix_height(win_T *wp) 3218 frame_fix_height(win_T *wp)
3203 { 3219 {
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 ;
3205 } 3225 }
3206 3226
3207 /* 3227 /*
3208 * Compute the minimal height for frame "topfrp". 3228 * Compute the minimal height for frame "topfrp".
3209 * Uses the 'winminheight' option. 3229 * Uses the 'winminheight' option.