diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-01-20 13:36:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-20 13:36:20 +0100 |
commit | 62254d2cc0d3cbd0e8aea75657ffb82e29ccfdfd (patch) | |
tree | 2a0e717767dfe5cb793edf3feefdaf983a87942e /src/nvim/window.c | |
parent | ed6b44e1be2e0a8a1245ec3295040a092d3a05e3 (diff) | |
parent | a2be9c7218d7fb431191cd6146fba61bcd1e193e (diff) | |
download | rneovim-62254d2cc0d3cbd0e8aea75657ffb82e29ccfdfd.tar.gz rneovim-62254d2cc0d3cbd0e8aea75657ffb82e29ccfdfd.tar.bz2 rneovim-62254d2cc0d3cbd0e8aea75657ffb82e29ccfdfd.zip |
Merge pull request #9429 from bfredl/grid_mouse
API/UI: add nvim_input_mouse() including multigrid mouse support
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r-- | src/nvim/window.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index 3cadfe612a..a2e3825274 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -5031,10 +5031,8 @@ void scroll_to_fraction(win_T *wp, int prev_height) } } -/// Set the width of a window. -void win_new_width(win_T *wp, int width) +void win_inner_width_changed(win_T *wp) { - wp->w_width = width; wp->w_lines_valid = 0; changed_line_abv_curs_win(wp); invalidate_botline_win(wp); @@ -5042,6 +5040,20 @@ void win_new_width(win_T *wp, int width) update_topline(); curs_columns(TRUE); /* validate w_wrow */ } +} + +/// Set the width of a window. +void win_new_width(win_T *wp, int width) +{ + wp->w_width = width; + // TODO(bfredl): refactor this. There should be some variable + // wp->w_inner_width which always contains the final actual width. + // Alternatively use wp->w_width for this and introduce wp->w_outer_width + // Then use this to fix terminal_resize. + if (!ui_is_external(kUIMultigrid) || wp->w_grid.requested_cols == 0) { + win_inner_width_changed(wp); + } + redraw_win_later(wp, NOT_VALID); wp->w_redr_status = TRUE; |