From 7ff1bc18a978d30f70db157be6f5fb2fb52b4215 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 27 Oct 2021 19:22:00 +0800 Subject: [PATCH] fix(float): redraw if w_border_adj changed --- src/nvim/window.c | 7 +++++-- test/functional/ui/float_spec.lua | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/nvim/window.c b/src/nvim/window.c index 4a21c2eee5..67bad9f8cf 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -725,8 +725,11 @@ void win_config_float(win_T *wp, FloatConfig fconfig) bool has_border = wp->w_floating && wp->w_float_config.border; for (int i = 0; i < 4; i++) { - wp->w_border_adj[i] = - has_border && wp->w_float_config.border_chars[2 * i+1][0]; + int new_adj = has_border && wp->w_float_config.border_chars[2 * i + 1][0]; + if (new_adj != wp->w_border_adj[i]) { + change_border = true; + wp->w_border_adj[i] = new_adj; + } } if (!ui_has(kUIMultigrid)) { diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 64b0cbcbfb..b6d80616b4 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -1196,7 +1196,6 @@ describe('float window', function() meths.win_set_config(win, {border={"", "_", "", "", "", "-", "", ""}}) if multigrid then - command('redraw!') -- TODO: without a redraw this test fails, which should be fixed screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|