mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #20645 from lewis6991/fix/decor_redraw_same_id
fix(decoration): redraw correctly when re-using ids
This commit is contained in:
commit
cb7da02701
@ -112,6 +112,7 @@ void extmark_set(buf_T *buf, uint32_t ns_id, uint32_t *idp, int row, colnr_T col
|
|||||||
marktree_revise(buf->b_marktree, itr, decor_level, old_mark);
|
marktree_revise(buf->b_marktree, itr, decor_level, old_mark);
|
||||||
goto revised;
|
goto revised;
|
||||||
}
|
}
|
||||||
|
decor_remove(buf, old_mark.pos.row, old_mark.pos.row, old_mark.decor_full);
|
||||||
marktree_del_itr(buf->b_marktree, itr, false);
|
marktree_del_itr(buf->b_marktree, itr, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2085,4 +2085,39 @@ describe('decorations: virt_text', function()
|
|||||||
]]}
|
]]}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('redraws correctly when re-using extmark ids', function()
|
||||||
|
command 'normal 5ohello'
|
||||||
|
|
||||||
|
screen:expect{grid=[[
|
||||||
|
|
|
||||||
|
hello |
|
||||||
|
hello |
|
||||||
|
hello |
|
||||||
|
hello |
|
||||||
|
hell^o |
|
||||||
|
{3:~ }|
|
||||||
|
{3:~ }|
|
||||||
|
{3:~ }|
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
|
||||||
|
local ns = meths.create_namespace('ns')
|
||||||
|
for row = 1, 5 do
|
||||||
|
meths.buf_set_extmark(0, ns, row, 0, { id = 1, virt_text = {{'world', 'Normal'}} })
|
||||||
|
end
|
||||||
|
|
||||||
|
screen:expect{grid=[[
|
||||||
|
|
|
||||||
|
hello |
|
||||||
|
hello |
|
||||||
|
hello |
|
||||||
|
hello |
|
||||||
|
hell^o world |
|
||||||
|
{3:~ }|
|
||||||
|
{3:~ }|
|
||||||
|
{3:~ }|
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user