aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-01-01 12:46:47 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2019-01-20 10:32:05 +0100
commita2be9c7218d7fb431191cd6146fba61bcd1e193e (patch)
tree6a18ff845b028572d6aa1f35900b571821a2082d /src/nvim/window.c
parent8a5c68f6959f8d315adb126ff49fd1970e7e75be (diff)
downloadrneovim-a2be9c7218d7fb431191cd6146fba61bcd1e193e.tar.gz
rneovim-a2be9c7218d7fb431191cd6146fba61bcd1e193e.tar.bz2
rneovim-a2be9c7218d7fb431191cd6146fba61bcd1e193e.zip
ui: multigrid mouse support
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c18
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;