window/ui: reorganize size variables, fix terminal window size with multigrid.

wp->w_height_inner now contains the "inner" size, regardless if the
window has been drawn yet or not. It should be used instead of
wp->w_grid.Rows, for stuff that is not directly related to accessing
the allocated grid memory, such like cursor movement and terminal size
This commit is contained in:
Björn Linse
2019-01-25 18:44:29 +01:00
parent 80b75bc99a
commit 2ab70cb55c
22 changed files with 321 additions and 227 deletions

View File

@@ -257,7 +257,7 @@ void ex_align(exarg_T *eap)
if (width <= 0)
width = curbuf->b_p_tw;
if (width == 0 && curbuf->b_p_wm > 0) {
width = curwin->w_grid.Columns - curbuf->b_p_wm;
width = curwin->w_width_inner - curbuf->b_p_wm;
}
if (width <= 0) {
width = 80;
@@ -2872,11 +2872,11 @@ void ex_z(exarg_T *eap)
// Vi compatible: ":z!" uses display height, without a count uses
// 'scroll'
if (eap->forceit) {
bigness = curwin->w_grid.Rows;
bigness = curwin->w_height_inner;
} else if (ONE_WINDOW) {
bigness = curwin->w_p_scr * 2;
} else {
bigness = curwin->w_grid.Rows - 3;
bigness = curwin->w_height_inner - 3;
}
if (bigness < 1) {
bigness = 1;