aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2022-10-14 11:49:57 +0100
committerLewis Russell <lewis6991@gmail.com>2022-10-14 13:03:03 +0100
commit546b294e74ac10d0a5e1216dd530fc96bdc66f29 (patch)
treeb43aaac69171cb60d9c16c2d677c1088baf90fe6 /test/functional
parent9931db2e3fa43ed02e1b0bc6f167ed5398fa6369 (diff)
downloadrneovim-546b294e74ac10d0a5e1216dd530fc96bdc66f29.tar.gz
rneovim-546b294e74ac10d0a5e1216dd530fc96bdc66f29.tar.bz2
rneovim-546b294e74ac10d0a5e1216dd530fc96bdc66f29.zip
fix(decoration): redraw correctly when re-using ids
00cfc1d (from #20249) reduced the amount of unnecessary redraws. This surfaced an issue where if and extmark with a specific ID is repositioned to a different row, the decorations from the old row were not redrawn and removed. This change fixes that by redrawing the old row.
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/ui/decorations_spec.lua35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index 0a5eefbf38..9448674a41 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -2085,4 +2085,39 @@ describe('decorations: virt_text', function()
]]}
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)