fix(column): reset decor state before starting from top

This commit is contained in:
Luuk van Baal 2023-11-23 16:23:26 +01:00 committed by Lewis Russell
parent b514edcdf4
commit df399ea0d2
2 changed files with 9 additions and 13 deletions

View File

@ -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;
}

View File

@ -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)