comparison src/window.c @ 26486:8d598308f113 v8.2.3773

patch 8.2.3773: wrong window size when a modeline changes 'columns' Commit: https://github.com/vim/vim/commit/8a7374f8c4eb4c016270ad908a43af4ddedcbf56 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 10 12:11:09 2021 +0000 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)
author Bram Moolenaar <Bram@vim.org>
date Fri, 10 Dec 2021 13:15:02 +0100
parents 2fc13817b100
children 06aa56b32df4
comparison
equal deleted inserted replaced
26485:9091abdf5363 26486:8d598308f113
5351 * This only does the current tab page, others must be done when made active. 5351 * This only does the current tab page, others must be done when made active.
5352 */ 5352 */
5353 void 5353 void
5354 shell_new_rows(void) 5354 shell_new_rows(void)
5355 { 5355 {
5356 int h = (int)ROWS_AVAIL; 5356 tabpage_T *tp;
5357 5357
5358 if (firstwin == NULL) // not initialized yet 5358 if (firstwin == NULL) // not initialized yet
5359 return; 5359 return;
5360 if (h < frame_minheight(topframe, NULL)) 5360
5361 h = frame_minheight(topframe, NULL); 5361 FOR_ALL_TABPAGES(tp)
5362 5362 {
5363 // First try setting the heights of windows with 'winfixheight'. If 5363 int h = (int)ROWS_AVAIL;
5364 // that doesn't result in the right height, forget about that option. 5364
5365 frame_new_height(topframe, h, FALSE, TRUE); 5365 if (h < frame_minheight(tp->tp_topframe, NULL))
5366 if (!frame_check_height(topframe, h)) 5366 h = frame_minheight(tp->tp_topframe, NULL);
5367 frame_new_height(topframe, h, FALSE, FALSE); 5367
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 }
5368 5374
5369 (void)win_comp_pos(); // recompute w_winrow and w_wincol 5375 (void)win_comp_pos(); // recompute w_winrow and w_wincol
5370 compute_cmdrow(); 5376 compute_cmdrow();
5371 curtab->tp_ch_used = p_ch; 5377 curtab->tp_ch_used = p_ch;
5372 5378
5381 * Called from win_new_shellsize() after Columns changed. 5387 * Called from win_new_shellsize() after Columns changed.
5382 */ 5388 */
5383 void 5389 void
5384 shell_new_columns(void) 5390 shell_new_columns(void)
5385 { 5391 {
5392 tabpage_T *tp;
5393
5386 if (firstwin == NULL) // not initialized yet 5394 if (firstwin == NULL) // not initialized yet
5387 return; 5395 return;
5388 5396
5389 // First try setting the widths of windows with 'winfixwidth'. If that 5397 FOR_ALL_TABPAGES(tp)
5390 // doesn't result in the right width, forget about that option. 5398 {
5391 frame_new_width(topframe, (int)Columns, FALSE, TRUE); 5399 // First try setting the widths of windows with 'winfixwidth'. If that
5392 if (!frame_check_width(topframe, Columns)) 5400 // doesn't result in the right width, forget about that option.
5393 frame_new_width(topframe, (int)Columns, FALSE, FALSE); 5401 frame_new_width(tp->tp_topframe, (int)Columns, FALSE, TRUE);
5402 if (!frame_check_width(tp->tp_topframe, Columns))
5403 frame_new_width(tp->tp_topframe, (int)Columns, FALSE, FALSE);
5404 }
5394 5405
5395 (void)win_comp_pos(); // recompute w_winrow and w_wincol 5406 (void)win_comp_pos(); // recompute w_winrow and w_wincol
5396 #if 0 5407 #if 0
5397 // Disabled: don't want making the screen smaller make a window larger. 5408 // Disabled: don't want making the screen smaller make a window larger.
5398 if (p_ea) 5409 if (p_ea)