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/misc1.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/misc1.c')
-rw-r--r-- | src/nvim/misc1.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index a66ded13f1..7f19bdf145 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -1251,7 +1251,7 @@ int plines_win_nofill( return 1; } - if (wp->w_grid.Columns == 0) { + if (wp->w_width_inner == 0) { return 1; } @@ -1261,8 +1261,8 @@ int plines_win_nofill( } const int lines = plines_win_nofold(wp, lnum); - if (winheight && lines > wp->w_grid.Rows) { - return wp->w_grid.Rows; + if (winheight && lines > wp->w_height_inner) { + return wp->w_height_inner; } return lines; } @@ -1292,7 +1292,7 @@ int plines_win_nofold(win_T *wp, linenr_T lnum) /* * Add column offset for 'number', 'relativenumber' and 'foldcolumn'. */ - width = wp->w_grid.Columns - win_col_off(wp); + width = wp->w_width_inner - win_col_off(wp); if (width <= 0 || col > 32000) { return 32000; // bigger than the number of screen columns } @@ -1318,7 +1318,7 @@ int plines_win_col(win_T *wp, linenr_T lnum, long column) if (!wp->w_p_wrap) return lines + 1; - if (wp->w_grid.Columns == 0) { + if (wp->w_width_inner == 0) { return lines + 1; } @@ -1341,7 +1341,7 @@ int plines_win_col(win_T *wp, linenr_T lnum, long column) } // Add column offset for 'number', 'relativenumber', 'foldcolumn', etc. - int width = wp->w_grid.Columns - win_col_off(wp); + int width = wp->w_width_inner - win_col_off(wp); if (width <= 0) { return 9999; } |