diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-06-15 09:03:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-15 09:03:39 +0800 |
commit | a05bbc60eaf2d18cb117345becd9d2d13fa4ce4c (patch) | |
tree | 4859fbae57f8a8f96a068df49fefe1fc1a319a2b /test/functional | |
parent | 78d77c03de579845fcaa761e7339c93fcd74efb2 (diff) | |
download | rneovim-a05bbc60eaf2d18cb117345becd9d2d13fa4ce4c.tar.gz rneovim-a05bbc60eaf2d18cb117345becd9d2d13fa4ce4c.tar.bz2 rneovim-a05bbc60eaf2d18cb117345becd9d2d13fa4ce4c.zip |
fix(extmarks): don't position overlay virt_text halfway a char (#24027)
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index 36c414e58f..940974e0b0 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -667,6 +667,8 @@ describe('extmark decorations', function() [31] = {underline = true, foreground = Screen.colors.DarkCyan}; [32] = {underline = true}; [33] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGray}; + [34] = {background = Screen.colors.Yellow}; + [35] = {background = Screen.colors.Yellow, bold = true, foreground = Screen.colors.Blue}; } ns = meths.create_namespace 'test' @@ -890,6 +892,25 @@ describe('extmark decorations', function() ]]} end) + it('overlay virtual text works on and after a TAB #24022', function() + screen:try_resize(40, 3) + meths.buf_set_lines(0, 0, -1, true, {'\t\tline 1'}) + meths.buf_set_extmark(0, ns, 0, 0, { virt_text = {{'AA', 'Search'}}, virt_text_pos = 'overlay', hl_mode = 'combine' }) + meths.buf_set_extmark(0, ns, 0, 1, { virt_text = {{'BB', 'Search'}}, virt_text_pos = 'overlay', hl_mode = 'combine' }) + meths.buf_set_extmark(0, ns, 0, 2, { virt_text = {{'CC', 'Search'}}, virt_text_pos = 'overlay', hl_mode = 'combine' }) + screen:expect{grid=[[ + {34:AA} ^ {34:BB} {34:CC}ne 1 | + {1:~ }| + | + ]]} + command('setlocal list listchars=tab:<->') + screen:expect{grid=[[ + {35:^AA}{1:----->}{35:BB}{1:----->}{34:CC}ne 1 | + {1:~ }| + | + ]]} + end) + it('can have virtual text of overlay position and styling', function() insert(example_text) feed 'gg' |