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/edit.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/edit.c')
-rw-r--r-- | src/nvim/edit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 90507cd0a5..bb16e2ae4d 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -566,7 +566,7 @@ static int insert_check(VimState *state) if (curwin->w_wcol < s->mincol - curbuf->b_p_ts && curwin->w_wrow == curwin->w_winrow - + curwin->w_grid.Rows - 1 - p_so + + curwin->w_height_inner - 1 - p_so && (curwin->w_cursor.lnum != curwin->w_topline || curwin->w_topfill > 0)) { if (curwin->w_topfill > 0) { @@ -5868,7 +5868,7 @@ static void check_auto_format( /* * Find out textwidth to be used for formatting: * if 'textwidth' option is set, use it - * else if 'wrapmargin' option is set, use curwin->w_grid.Columns-'wrapmargin' + * else if 'wrapmargin' option is set, use curwin->w_width_inner-'wrapmargin' * if invalid value, use 0. * Set default to window width (maximum 79) for "gq" operator. */ @@ -5883,7 +5883,7 @@ comp_textwidth ( if (textwidth == 0 && curbuf->b_p_wm) { /* The width is the window width minus 'wrapmargin' minus all the * things that add to the margin. */ - textwidth = curwin->w_grid.Columns - curbuf->b_p_wm; + textwidth = curwin->w_width_inner - curbuf->b_p_wm; if (cmdwin_type != 0) { textwidth -= 1; } @@ -5899,7 +5899,7 @@ comp_textwidth ( if (textwidth < 0) textwidth = 0; if (ff && textwidth == 0) { - textwidth = curwin->w_grid.Columns - 1; + textwidth = curwin->w_width_inner - 1; if (textwidth > 79) { textwidth = 79; } |