diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-07-07 07:21:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-07 07:21:12 +0800 |
commit | 36941942d60915d9f78defd6aaf713a27952e16a (patch) | |
tree | cb3c9ab9d44b4822e8b9328009243e9f3e2c4237 /test/functional/ui | |
parent | 06c4edf46bf65ec6b540de355cf1a691533f1df9 (diff) | |
download | rneovim-36941942d60915d9f78defd6aaf713a27952e16a.tar.gz rneovim-36941942d60915d9f78defd6aaf713a27952e16a.tar.bz2 rneovim-36941942d60915d9f78defd6aaf713a27952e16a.zip |
fix(drawline): inline virt_text hl_mode inside syntax/extmark hl (#24273)
Diffstat (limited to 'test/functional/ui')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index 8070ac550d..0c4df563cc 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -2107,6 +2107,49 @@ bbbbbbb]]) ]]} end) + it('inside highlight range of another extmark', function() + insert('foo foo foo foo\nfoo foo foo foo') + meths.buf_set_extmark(0, ns, 0, 8, { virt_text = { { 'AAA', 'Special' } }, virt_text_pos = 'inline' }) + meths.buf_set_extmark(0, ns, 0, 8, { virt_text = { { 'BBB', 'Special' } }, virt_text_pos = 'inline', hl_mode = 'combine' }) + meths.buf_set_extmark(0, ns, 1, 8, { virt_text = { { 'CCC', 'Special' } }, virt_text_pos = 'inline', hl_mode = 'combine' }) + meths.buf_set_extmark(0, ns, 1, 8, { virt_text = { { 'DDD', 'Special' } }, virt_text_pos = 'inline', hl_mode = 'replace' }) + meths.buf_set_extmark(0, ns, 0, 4, { end_col = 11, hl_group = 'Search' }) + meths.buf_set_extmark(0, ns, 1, 4, { end_col = 11, hl_group = 'Search' }) + screen:expect{grid=[[ + foo {12:foo }{10:AAA}{19:BBB}{12:foo} foo | + foo {12:foo }{19:CCC}{10:DDD}{12:foo} fo^o | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]} + end) + + it('inside highlight range of syntax', function() + insert('foo foo foo foo\nfoo foo foo foo') + meths.buf_set_extmark(0, ns, 0, 8, { virt_text = { { 'AAA', 'Special' } }, virt_text_pos = 'inline' }) + meths.buf_set_extmark(0, ns, 0, 8, { virt_text = { { 'BBB', 'Special' } }, virt_text_pos = 'inline', hl_mode = 'combine' }) + meths.buf_set_extmark(0, ns, 1, 8, { virt_text = { { 'CCC', 'Special' } }, virt_text_pos = 'inline', hl_mode = 'combine' }) + meths.buf_set_extmark(0, ns, 1, 8, { virt_text = { { 'DDD', 'Special' } }, virt_text_pos = 'inline', hl_mode = 'replace' }) + command([[syntax match Search 'foo \zsfoo foo\ze foo']]) + screen:expect{grid=[[ + foo {12:foo }{10:AAA}{19:BBB}{12:foo} foo | + foo {12:foo }{19:CCC}{10:DDD}{12:foo} fo^o | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]} + end) + it('cursor position is correct when inserting around a virtual text with right gravity set to false', function() insert('foo foo foo foo') meths.buf_set_extmark(0, ns, 0, 8, |