fix(column): clear "b_signcols" when marktree is cleared

This commit is contained in:
Luuk van Baal authored and Lewis Russell committed 2024-01-22 20:39:24 +00:00
1 parent 51f783f2fa
commit 13d50c3b13
2 files changed
+26

No files matched your search

+3
View File
@@ -309,6 +309,9 @@ void extmark_free_all(buf_T *buf)
marktree_clear(buf->b_marktree);
buf->b_signcols.max = 0;
CLEAR_FIELD(buf->b_signcols.count);
map_destroy(uint32_t, buf->b_extmark_ns);
*buf->b_extmark_ns = (Map(uint32_t, uint32_t)) MAP_INIT;
}
+23
View File
@@ -4998,6 +4998,29 @@ l5
|
]]}
end)
it('correct width after wiping a buffer', function()
screen:try_resize(20, 4)
insert(example_test3)
feed('gg')
local buf = api.nvim_get_current_buf()
api.nvim_buf_set_extmark(buf, ns, 0, 0, { sign_text = 'h' })
screen:expect{grid=[[
h ^l1 |
{1: }l2 |
{1: }l3 |
|
]]}
api.nvim_win_set_buf(0, api.nvim_create_buf(false, true))
api.nvim_buf_delete(buf, {unload=true, force=true})
api.nvim_buf_set_lines(buf, 0, -1, false, {''})
api.nvim_win_set_buf(0, buf)
screen:expect{grid=[[
^ |
{2:~ }|*2
|
]]}
end)
end)
describe('decorations: virt_text', function()