diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-01-25 18:44:29 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-01-27 12:07:06 +0100 |
commit | 2ab70cb55c80b17fb4100dd7f2d056131c02b08b (patch) | |
tree | e3a4cc06776b51d1ec4e9733d377452d0158b4c3 /src/nvim/cursor.c | |
parent | 80b75bc99aeb6ecc40e59343ec527443d882e8ec (diff) | |
download | rneovim-2ab70cb55c80b17fb4100dd7f2d056131c02b08b.tar.gz rneovim-2ab70cb55c80b17fb4100dd7f2d056131c02b08b.tar.bz2 rneovim-2ab70cb55c80b17fb4100dd7f2d056131c02b08b.zip |
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
Diffstat (limited to 'src/nvim/cursor.c')
-rw-r--r-- | src/nvim/cursor.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c index 6c1bd01ff5..bc14761877 100644 --- a/src/nvim/cursor.c +++ b/src/nvim/cursor.c @@ -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(); /* |