aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2022-11-28 23:25:50 +0100
committerLuuk van Baal <luukvbaal@gmail.com>2022-11-29 01:14:08 +0100
commit6b18c77a276f95691708fbff72ed75bac9214a2c (patch)
treebfd413188191e62da73228c6a3eb9b5cb8cbe125
parentbf0665b3f320cd183bd1f960cc8501fca60ced9e (diff)
downloadrneovim-6b18c77a276f95691708fbff72ed75bac9214a2c.tar.gz
rneovim-6b18c77a276f95691708fbff72ed75bac9214a2c.tar.bz2
rneovim-6b18c77a276f95691708fbff72ed75bac9214a2c.zip
refactor(ui): statusbar invalidation to win_set_inner_size()
Problem: w_redr_status invalidation is duplicated in multiple functions that all call win_set_inner_size(). Solution: Move to win_set_inner_size().
-rw-r--r--src/nvim/window.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 3d10f89a2c..d29a364b4f 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -6389,9 +6389,6 @@ void win_new_height(win_T *wp, int height)
wp->w_height = height;
wp->w_pos_changed = true;
win_set_inner_size(wp, true);
- if (wp->w_status_height) {
- wp->w_redr_status = true;
- }
}
void scroll_to_fraction(win_T *wp, int prev_height)
@@ -6487,7 +6484,6 @@ void scroll_to_fraction(win_T *wp, int prev_height)
}
redraw_later(wp, UPD_SOME_VALID);
- wp->w_redr_status = true;
invalidate_botline_win(wp);
}
@@ -6554,6 +6550,7 @@ void win_set_inner_size(win_T *wp, bool valid_cursor)
wp->w_width_outer = (wp->w_width_inner + win_border_width(wp));
wp->w_winrow_off = wp->w_border_adj[0] + wp->w_winbar_height;
wp->w_wincol_off = wp->w_border_adj[3];
+ wp->w_redr_status = true;
}
static int win_border_height(win_T *wp)
@@ -6570,10 +6567,8 @@ static int win_border_width(win_T *wp)
void win_new_width(win_T *wp, int width)
{
wp->w_width = width;
- win_set_inner_size(wp, true);
-
- wp->w_redr_status = true;
wp->w_pos_changed = true;
+ win_set_inner_size(wp, true);
}
void win_comp_scroll(win_T *wp)
@@ -6974,7 +6969,6 @@ int set_winbar_win(win_T *wp, bool make_room, bool valid_cursor)
}
wp->w_winbar_height = winbar_height;
win_set_inner_size(wp, valid_cursor);
- wp->w_redr_status = wp->w_redr_status || winbar_height;
if (winbar_height == 0) {
// When removing winbar, deallocate the w_winbar_click_defs array