From df399ea0d20e86027d0b59ca4bbd445c1d035a67 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Thu, 23 Nov 2023 16:23:26 +0100 Subject: [PATCH] fix(column): reset decor state before starting from top --- src/nvim/drawscreen.c | 1 + test/functional/ui/statuscolumn_spec.lua | 21 ++++++++------------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c index fee2f288f6..b28c279163 100644 --- a/src/nvim/drawscreen.c +++ b/src/nvim/drawscreen.c @@ -2335,6 +2335,7 @@ static void win_update(win_T *wp, DecorProviders *providers) lnum = wp->w_topline; wp->w_lines_valid = 0; wp->w_valid &= ~VALID_WCOL; + decor_redraw_reset(wp, &decor_state); decor_providers_invoke_win(wp, providers, &line_providers); continue; } diff --git a/test/functional/ui/statuscolumn_spec.lua b/test/functional/ui/statuscolumn_spec.lua index 61f6419f8c..dd11fa7c15 100644 --- a/test/functional/ui/statuscolumn_spec.lua +++ b/test/functional/ui/statuscolumn_spec.lua @@ -46,22 +46,17 @@ describe('statuscolumn', function() end) it("widens with irregular 'statuscolumn' width", function() - command([[set stc=%{v:relnum?v:relnum:(v:lnum==5?'bbbbb':v:lnum)}]]) - command('norm 5G | redraw!') + screen:try_resize(screen._width, 4) + command([=[ + set stc=%{v:relnum?v:relnum:(v:lnum==5?'bbbbb':v:lnum)} + let ns = nvim_create_namespace('') + call nvim_buf_set_extmark(0, ns, 3, 0, {'virt_text':[['virt_text']]}) + norm 5G | redraw! + ]=]) screen:expect([[ - 1 aaaaa | + 1 aaaaa virt_text | bbbbba^eaaa | 1 aaaaa | - 2 aaaaa | - 3 aaaaa | - 4 aaaaa | - 5 aaaaa | - 6 aaaaa | - 7 aaaaa | - 8 aaaaa | - 9 aaaaa | - 10 aaaaa | - 11 aaaaa | | ]]) end)