aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-07-29 11:31:59 +0200
committerSean Dewar <seandewar@users.noreply.github.com>2021-09-16 14:40:32 +0100
commit41f761130e4fcbe415e206a92e3161248aa11152 (patch)
treea04d73e9dddcedf718e45d7e2def59e68321b82d /test
parenta265201307f6d7551518b67e16de68f5b9e2527c (diff)
downloadrneovim-41f761130e4fcbe415e206a92e3161248aa11152.tar.gz
rneovim-41f761130e4fcbe415e206a92e3161248aa11152.tar.bz2
rneovim-41f761130e4fcbe415e206a92e3161248aa11152.zip
backport: fix(decorations): crash when :bdelete (extmark_free_all) after clear_namespace
fixes #15212
Diffstat (limited to 'test')
-rw-r--r--test/functional/ui/decorations_spec.lua46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index 98aafd8757..0e4b3574e9 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -697,4 +697,50 @@ end]]
|
]]}
end)
+ it('does not crash when deleting a cleared buffer #15212', function()
+ exec_lua [[
+ ns = vim.api.nvim_create_namespace("myplugin")
+ vim.api.nvim_buf_set_extmark(0, ns, 0, 0, {virt_text = {{"a"}}, end_col = 0})
+ ]]
+ screen:expect{grid=[[
+ ^ a |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]]}
+
+ exec_lua [[
+ vim.api.nvim_buf_clear_namespace(0, ns, 0, -1)
+ vim.cmd("bdelete")
+ ]]
+ screen:expect{grid=[[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]]}
+ helpers.assert_alive()
+ end)
end)