aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-11-26 21:07:29 +0100
committerbfredl <bjorn.linse@gmail.com>2023-11-28 10:35:25 +0100
commitae3685798deaf51f14422c568998998c03f91f2c (patch)
treee68c931455caf785a1abde270189cca9ea80eead /test/functional/ui
parent6c14ae6bfaf51415b555e9a6b85d1d280976358d (diff)
downloadrneovim-ae3685798deaf51f14422c568998998c03f91f2c.tar.gz
rneovim-ae3685798deaf51f14422c568998998c03f91f2c.tar.bz2
rneovim-ae3685798deaf51f14422c568998998c03f91f2c.zip
feat(decoration): allow conceal_char to be a composing char
decor->text.str pointer must go. This removes it for conceal char, in preparation for a larger PR which will also handle the sign case. By actually allowing composing chars for a conceal chars, this becomes a feature and not just a refactor, as a bonus.
Diffstat (limited to 'test/functional/ui')
-rw-r--r--test/functional/ui/decorations_spec.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index 9853f05cf2..ef02f73960 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -13,6 +13,7 @@ local curbufmeths = helpers.curbufmeths
local command = helpers.command
local eq = helpers.eq
local assert_alive = helpers.assert_alive
+local pcall_err = helpers.pcall_err
describe('decorations providers', function()
local screen
@@ -1650,6 +1651,34 @@ describe('extmark decorations', function()
]])
command('set conceallevel=1')
screen:expect_unchanged()
+
+ eq("conceal char has to be printable", pcall_err(meths.buf_set_extmark, 0, ns, 0, 0, {end_col=0, end_row=2, conceal='\255'}))
+ end)
+
+ it('conceal with composed conceal char', function()
+ screen:try_resize(50, 5)
+ insert('foo\n')
+ meths.buf_set_extmark(0, ns, 0, 0, {end_col=0, end_row=2, conceal='ẍ̲'})
+ command('set conceallevel=2')
+ screen:expect([[
+ {26:ẍ̲} |
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ |
+ ]])
+ command('set conceallevel=1')
+ screen:expect_unchanged()
+
+ -- this is rare, but could happen. Save at least the first codepoint
+ meths._invalidate_glyph_cache()
+ screen:expect{grid=[[
+ {26:x} |
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ |
+ ]]}
end)
it('conceal without conceal char #24782', function()