diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-09-22 14:21:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-22 14:21:58 +0800 |
commit | 34a786bc49598eeafef3fffcb0836d4557e51638 (patch) | |
tree | b9ba22ef5c8ddfb95249ffa1c61032ff9d7a8ccb /test | |
parent | fcfc87cb7727eb63265dc75476dc6ba56e0029c8 (diff) | |
download | rneovim-34a786bc49598eeafef3fffcb0836d4557e51638.tar.gz rneovim-34a786bc49598eeafef3fffcb0836d4557e51638.tar.bz2 rneovim-34a786bc49598eeafef3fffcb0836d4557e51638.zip |
fix(extmarks): inline virt_text support multiple hl groups (#25303)
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index d6a6243be2..c4fd6379f3 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -1464,6 +1464,8 @@ describe('extmark decorations', function() end) it('can have virtual text which combines foreground and background groups', function() + screen:try_resize(20, 3) + screen:set_default_attr_ids { [1] = {bold=true, foreground=Screen.colors.Blue}; [2] = {background = tonumber('0x123456'), foreground = tonumber('0xbbbbbb')}; @@ -1481,30 +1483,21 @@ describe('extmark decorations', function() hi VeryBold gui=bold ]] - meths.buf_set_extmark(0, ns, 0, 0, { virt_text={ + insert('##') + local vt = { {'a', {'BgOne', 'FgEin'}}; {'b', {'BgOne', 'FgZwei'}}; {'c', {'BgTwo', 'FgEin'}}; {'d', {'BgTwo', 'FgZwei'}}; {'X', {'BgTwo', 'FgZwei', 'VeryBold'}}; - }}) - + } + meths.buf_set_extmark(0, ns, 0, 0, { virt_text = vt, virt_text_pos = 'eol' }) + meths.buf_set_extmark(0, ns, 0, 0, { virt_text = vt, virt_text_pos = 'right_align' }) + meths.buf_set_extmark(0, ns, 0, 0, { virt_text = vt, virt_text_pos = 'inline' }) screen:expect{grid=[[ - ^ {2:a}{3:b}{4:c}{5:d}{6:X} | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - | + {2:a}{3:b}{4:c}{5:d}{6:X}#^# {2:a}{3:b}{4:c}{5:d}{6:X} {2:a}{3:b}{4:c}{5:d}{6:X}| + {1:~ }| + | ]]} end) |