comparison src/window.c @ 26488:06aa56b32df4 v8.2.3774

patch 8.2.3774: test for command line height fails Commit: https://github.com/vim/vim/commit/b711814cb64b60ec4918e3e1fb2ca5c50d6e9340 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 10 13:40:08 2021 +0000 patch 8.2.3774: test for command line height fails Problem: Test for command line height fails. Solution: Use another way to handle window size change.
author Bram Moolenaar <Bram@vim.org>
date Fri, 10 Dec 2021 14:45:03 +0100
parents 8d598308f113
children 255bc9a08e58
comparison
equal deleted inserted replaced
26487:24b0a8540cf4 26488:06aa56b32df4
4190 tp->tp_curwin = curwin; 4190 tp->tp_curwin = curwin;
4191 tp->tp_prevwin = prevwin; 4191 tp->tp_prevwin = prevwin;
4192 tp->tp_firstwin = firstwin; 4192 tp->tp_firstwin = firstwin;
4193 tp->tp_lastwin = lastwin; 4193 tp->tp_lastwin = lastwin;
4194 tp->tp_old_Rows = Rows; 4194 tp->tp_old_Rows = Rows;
4195 tp->tp_old_Columns = Columns; 4195 if (tp->tp_old_Columns != -1)
4196 tp->tp_old_Columns = Columns;
4196 firstwin = NULL; 4197 firstwin = NULL;
4197 lastwin = NULL; 4198 lastwin = NULL;
4198 return OK; 4199 return OK;
4199 } 4200 }
4200 4201
4253 #ifdef FEAT_GUI_TABLINE 4254 #ifdef FEAT_GUI_TABLINE
4254 && !gui_use_tabline() 4255 && !gui_use_tabline()
4255 #endif 4256 #endif
4256 )) 4257 ))
4257 shell_new_rows(); 4258 shell_new_rows();
4258 if (curtab->tp_old_Columns != Columns && starting == 0) 4259 if (curtab->tp_old_Columns != Columns)
4259 shell_new_columns(); // update window widths 4260 {
4261 if (starting == 0)
4262 {
4263 shell_new_columns(); // update window widths
4264 curtab->tp_old_Columns = Columns;
4265 }
4266 else
4267 curtab->tp_old_Columns = -1; // update window widths later
4268 }
4260 4269
4261 lastused_tabpage = last_tab; 4270 lastused_tabpage = last_tab;
4262 4271
4263 #if defined(FEAT_GUI) 4272 #if defined(FEAT_GUI)
4264 // When 'guioptions' includes 'L' or 'R' may have to remove or add 4273 // When 'guioptions' includes 'L' or 'R' may have to remove or add
5351 * This only does the current tab page, others must be done when made active. 5360 * This only does the current tab page, others must be done when made active.
5352 */ 5361 */
5353 void 5362 void
5354 shell_new_rows(void) 5363 shell_new_rows(void)
5355 { 5364 {
5356 tabpage_T *tp; 5365 int h = (int)ROWS_AVAIL;
5357 5366
5358 if (firstwin == NULL) // not initialized yet 5367 if (firstwin == NULL) // not initialized yet
5359 return; 5368 return;
5360 5369 if (h < frame_minheight(topframe, NULL))
5361 FOR_ALL_TABPAGES(tp) 5370 h = frame_minheight(topframe, NULL);
5362 { 5371
5363 int h = (int)ROWS_AVAIL; 5372 // First try setting the heights of windows with 'winfixheight'. If
5364 5373 // that doesn't result in the right height, forget about that option.
5365 if (h < frame_minheight(tp->tp_topframe, NULL)) 5374 frame_new_height(topframe, h, FALSE, TRUE);
5366 h = frame_minheight(tp->tp_topframe, NULL); 5375 if (!frame_check_height(topframe, h))
5367 5376 frame_new_height(topframe, h, FALSE, FALSE);
5368 // First try setting the heights of windows with 'winfixheight'. If
5369 // that doesn't result in the right height, forget about that option.
5370 frame_new_height(tp->tp_topframe, h, FALSE, TRUE);
5371 if (!frame_check_height(tp->tp_topframe, h))
5372 frame_new_height(tp->tp_topframe, h, FALSE, FALSE);
5373 }
5374 5377
5375 (void)win_comp_pos(); // recompute w_winrow and w_wincol 5378 (void)win_comp_pos(); // recompute w_winrow and w_wincol
5376 compute_cmdrow(); 5379 compute_cmdrow();
5377 curtab->tp_ch_used = p_ch; 5380 curtab->tp_ch_used = p_ch;
5378 5381
5387 * Called from win_new_shellsize() after Columns changed. 5390 * Called from win_new_shellsize() after Columns changed.
5388 */ 5391 */
5389 void 5392 void
5390 shell_new_columns(void) 5393 shell_new_columns(void)
5391 { 5394 {
5392 tabpage_T *tp;
5393
5394 if (firstwin == NULL) // not initialized yet 5395 if (firstwin == NULL) // not initialized yet
5395 return; 5396 return;
5396 5397
5397 FOR_ALL_TABPAGES(tp) 5398 // First try setting the widths of windows with 'winfixwidth'. If that
5398 { 5399 // doesn't result in the right width, forget about that option.
5399 // First try setting the widths of windows with 'winfixwidth'. If that 5400 frame_new_width(topframe, (int)Columns, FALSE, TRUE);
5400 // doesn't result in the right width, forget about that option. 5401 if (!frame_check_width(topframe, Columns))
5401 frame_new_width(tp->tp_topframe, (int)Columns, FALSE, TRUE); 5402 frame_new_width(topframe, (int)Columns, FALSE, FALSE);
5402 if (!frame_check_width(tp->tp_topframe, Columns))
5403 frame_new_width(tp->tp_topframe, (int)Columns, FALSE, FALSE);
5404 }
5405 5403
5406 (void)win_comp_pos(); // recompute w_winrow and w_wincol 5404 (void)win_comp_pos(); // recompute w_winrow and w_wincol
5407 #if 0 5405 #if 0
5408 // Disabled: don't want making the screen smaller make a window larger. 5406 // Disabled: don't want making the screen smaller make a window larger.
5409 if (p_ea) 5407 if (p_ea)