aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2025-01-09 13:37:28 +0100
committerGitHub <noreply@github.com>2025-01-09 13:37:28 +0100
commitdcaf8bef08d094889ef5fac24d123871dd0e6a6f (patch)
tree6a720b1075cf58cde9d6f784ce41b6d7df0b0a6a /test
parent6dd7fcaafdc5d80948e1c4b05b19584de16528d6 (diff)
parent33ff546b50f759bd49d9518a94f8c2416848bdd7 (diff)
downloadrneovim-dcaf8bef08d094889ef5fac24d123871dd0e6a6f.tar.gz
rneovim-dcaf8bef08d094889ef5fac24d123871dd0e6a6f.tar.bz2
rneovim-dcaf8bef08d094889ef5fac24d123871dd0e6a6f.zip
Merge pull request #31844 from bfredl/iter_crash
fix(decoration): fix crash when on_lines decor provider modifies marktree
Diffstat (limited to 'test')
-rw-r--r--test/functional/ui/decorations_spec.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index da0fb9849a..e364c473b7 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -744,6 +744,30 @@ describe('decorations providers', function()
]])
eq(2, exec_lua([[return _G.cnt]]))
end)
+
+ it('can do large changes to the marktree', function()
+ insert("line1 with a lot of text\nline2 with a lot of text")
+ setup_provider([[
+ function on_do(event, _, _, row)
+ if event == 'win' or (event == 'line' and row == 1) then
+ vim.api.nvim_buf_clear_namespace(0, ns1, 0, -1)
+ for i = 0,1 do
+ for j = 0,23 do
+ vim.api.nvim_buf_set_extmark(0, ns1, i, j, {hl_group='ErrorMsg', end_col = j+1})
+ end
+ end
+ end
+ end
+ ]])
+
+ -- Doesn't crash when modifying the marktree between line1 and line2
+ screen:expect([[
+ {2:line1 with a lot of text} |
+ {2:line2 with a lot of tex^t} |
+ {1:~ }|*5
+ |
+ ]])
+ end)
end)
local example_text = [[