Mercurial > vim
comparison src/window.c @ 9102:0e90f3e13d88 v7.4.1835
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 24 11:31:32 2016 +0200
patch 7.4.1835
Problem: When splitting and closing a window the status height changes.
Solution: Compute the frame height correctly. (Hirohito Higashi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 24 May 2016 11:45:06 +0200 |
parents | dc10bd23f918 |
children | 6c4d610fce0a |
comparison
equal
deleted
inserted
replaced
9101:5a74e6eee963 | 9102:0e90f3e13d88 |
---|---|
1163 | 1163 |
1164 /* "new_size" of the current window goes to the new window, use | 1164 /* "new_size" of the current window goes to the new window, use |
1165 * one row for the status line */ | 1165 * one row for the status line */ |
1166 win_new_height(wp, new_size); | 1166 win_new_height(wp, new_size); |
1167 if (flags & (WSP_TOP | WSP_BOT)) | 1167 if (flags & (WSP_TOP | WSP_BOT)) |
1168 frame_new_height(curfrp, curfrp->fr_height | 1168 { |
1169 - (new_size + STATUS_HEIGHT), flags & WSP_TOP, FALSE); | 1169 int new_fr_height = curfrp->fr_height - new_size; |
1170 | |
1171 if (!((flags & WSP_BOT) && p_ls == 0)) | |
1172 new_fr_height -= STATUS_HEIGHT; | |
1173 frame_new_height(curfrp, new_fr_height, flags & WSP_TOP, FALSE); | |
1174 } | |
1170 else | 1175 else |
1171 win_new_height(oldwin, oldwin_height - (new_size + STATUS_HEIGHT)); | 1176 win_new_height(oldwin, oldwin_height - (new_size + STATUS_HEIGHT)); |
1172 if (before) /* new window above current one */ | 1177 if (before) /* new window above current one */ |
1173 { | 1178 { |
1174 wp->w_winrow = oldwin->w_winrow; | 1179 wp->w_winrow = oldwin->w_winrow; |
1177 } | 1182 } |
1178 else /* new window below current one */ | 1183 else /* new window below current one */ |
1179 { | 1184 { |
1180 wp->w_winrow = oldwin->w_winrow + oldwin->w_height + STATUS_HEIGHT; | 1185 wp->w_winrow = oldwin->w_winrow + oldwin->w_height + STATUS_HEIGHT; |
1181 wp->w_status_height = oldwin->w_status_height; | 1186 wp->w_status_height = oldwin->w_status_height; |
1182 /* Don't set the status_height for oldwin yet, this might break | 1187 if (!(flags & WSP_BOT)) |
1183 * frame_fix_height(oldwin), therefore will be set below. */ | 1188 oldwin->w_status_height = STATUS_HEIGHT; |
1184 } | 1189 } |
1185 if (flags & WSP_BOT) | 1190 if (flags & WSP_BOT) |
1186 frame_add_statusline(curfrp); | 1191 frame_add_statusline(curfrp); |
1187 frame_fix_height(wp); | 1192 frame_fix_height(wp); |
1188 frame_fix_height(oldwin); | 1193 frame_fix_height(oldwin); |
1189 | |
1190 if (!before) | |
1191 /* new window above current one, set the status_height after | |
1192 * frame_fix_height(oldwin) */ | |
1193 oldwin->w_status_height = STATUS_HEIGHT; | |
1194 } | 1194 } |
1195 | 1195 |
1196 if (flags & (WSP_TOP | WSP_BOT)) | 1196 if (flags & (WSP_TOP | WSP_BOT)) |
1197 (void)win_comp_pos(); | 1197 (void)win_comp_pos(); |
1198 | 1198 |