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

@@ -121,11 +121,11 @@ static int coladvance2(
--curwin->w_curswant;
}
} else {
int width = curwin->w_grid.Columns - win_col_off(curwin);
int width = curwin->w_width_inner - win_col_off(curwin);
if (finetune
&& curwin->w_p_wrap
&& curwin->w_grid.Columns != 0
&& curwin->w_width_inner != 0
&& wcol >= (colnr_T)width) {
csize = linetabsize(line);
if (csize > 0)
@@ -230,7 +230,7 @@ static int coladvance2(
int b = (int)wcol - (int)col;
// The difference between wcol and col is used to set coladd.
if (b > 0 && b < (MAXCOL - 2 * curwin->w_grid.Columns)) {
if (b > 0 && b < (MAXCOL - 2 * curwin->w_width_inner)) {
pos->coladd = b;
}
@@ -444,7 +444,7 @@ bool leftcol_changed(void)
bool retval = false;
changed_cline_bef_curs();
lastcol = curwin->w_leftcol + curwin->w_grid.Columns - curwin_col_off() - 1;
lastcol = curwin->w_leftcol + curwin->w_width_inner - curwin_col_off() - 1;
validate_virtcol();
/*