aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-19 20:34:58 +0800
committerGitHub <noreply@github.com>2023-08-19 20:34:58 +0800
commit421713523e154009223c31cdbfe8486262c6f5e4 (patch)
treecfbe815435ecb39d3403fa5430003a336f181928 /test/functional
parentc8e58bf09c4abc92c8689a80eb90150c5ff3cdfc (diff)
downloadrneovim-421713523e154009223c31cdbfe8486262c6f5e4.tar.gz
rneovim-421713523e154009223c31cdbfe8486262c6f5e4.tar.bz2
rneovim-421713523e154009223c31cdbfe8486262c6f5e4.zip
vim-patch:9.0.1745: Missing test coverage for blockwise Visual highlight (#24790)
Problem: Missing test coverage for blockwise Visual highlight with virtual that starts with a double-width char. Solution: Add a new virtual text to the test. Some other small fixes. closes: vim/vim#12835 https://github.com/vim/vim/commit/fc3058495d3ff58c8f2b9dd4452d0840f2d1fa42
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/ui/decorations_spec.lua46
1 files changed, 28 insertions, 18 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index 395176f005..ed562555e3 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -2831,146 +2831,156 @@ bbbbbbb]])
it('blockwise Visual highlight with double-width virtual text (replace)', function()
screen:try_resize(60, 6)
- insert('123456789\n123456789\n123456789')
+ insert('123456789\n123456789\n123456789\n123456789')
meths.buf_set_extmark(0, ns, 1, 1, {
virt_text = { { '-口-', 'Special' } },
virt_text_pos = 'inline',
hl_mode = 'replace',
})
+ meths.buf_set_extmark(0, ns, 2, 2, {
+ virt_text = { { '口', 'Special' } },
+ virt_text_pos = 'inline',
+ hl_mode = 'replace',
+ })
feed('gg0')
screen:expect{grid=[[
^123456789 |
1{10:-口-}23456789 |
+ 12{10:口}3456789 |
123456789 |
{1:~ }|
- {1:~ }|
|
]]}
- feed('<C-V>2jl')
+ feed('<C-V>3jl')
screen:expect{grid=[[
{7:12}3456789 |
{7:1}{10:-口-}23456789 |
+ {7:12}{10:口}3456789 |
{7:1}^23456789 |
{1:~ }|
- {1:~ }|
{8:-- VISUAL BLOCK --} |
]]}
feed('l')
screen:expect{grid=[[
{7:123}456789 |
{7:1}{10:-口-}23456789 |
+ {7:12}{10:口}3456789 |
{7:12}^3456789 |
{1:~ }|
- {1:~ }|
{8:-- VISUAL BLOCK --} |
]]}
feed('4l')
screen:expect{grid=[[
{7:1234567}89 |
{7:1}{10:-口-}{7:23}456789 |
+ {7:12}{10:口}{7:345}6789 |
{7:123456}^789 |
{1:~ }|
- {1:~ }|
{8:-- VISUAL BLOCK --} |
]]}
feed('Ol')
screen:expect{grid=[[
1{7:234567}89 |
1{10:-口-}{7:23}456789 |
+ 1{7:2}{10:口}{7:345}6789 |
1^2{7:34567}89 |
{1:~ }|
- {1:~ }|
{8:-- VISUAL BLOCK --} |
]]}
feed('l')
screen:expect{grid=[[
12{7:34567}89 |
1{10:-口-}{7:23}456789 |
+ 12{10:口}{7:345}6789 |
12^3{7:4567}89 |
{1:~ }|
- {1:~ }|
{8:-- VISUAL BLOCK --} |
]]}
feed('l')
screen:expect{grid=[[
123{7:4567}89 |
1{10:-口-}{7:23}456789 |
+ 12{10:口}{7:345}6789 |
123^4{7:567}89 |
{1:~ }|
- {1:~ }|
{8:-- VISUAL BLOCK --} |
]]}
end)
it('blockwise Visual highlight with double-width virtual text (combine)', function()
screen:try_resize(60, 6)
- insert('123456789\n123456789\n123456789')
+ insert('123456789\n123456789\n123456789\n123456789')
meths.buf_set_extmark(0, ns, 1, 1, {
virt_text = { { '-口-', 'Special' } },
virt_text_pos = 'inline',
hl_mode = 'combine',
})
+ meths.buf_set_extmark(0, ns, 2, 2, {
+ virt_text = { { '口', 'Special' } },
+ virt_text_pos = 'inline',
+ hl_mode = 'combine',
+ })
feed('gg0')
screen:expect{grid=[[
^123456789 |
1{10:-口-}23456789 |
+ 12{10:口}3456789 |
123456789 |
{1:~ }|
- {1:~ }|
|
]]}
- feed('<C-V>2jl')
+ feed('<C-V>3jl')
screen:expect{grid=[[
{7:12}3456789 |
{7:1}{20:-}{10:口-}23456789 |
+ {7:12}{10:口}3456789 |
{7:1}^23456789 |
{1:~ }|
- {1:~ }|
{8:-- VISUAL BLOCK --} |
]]}
feed('l')
screen:expect{grid=[[
{7:123}456789 |
{7:1}{20:-口}{10:-}23456789 |
+ {7:12}{20:口}3456789 |
{7:12}^3456789 |
{1:~ }|
- {1:~ }|
{8:-- VISUAL BLOCK --} |
]]}
feed('4l')
screen:expect{grid=[[
{7:1234567}89 |
{7:1}{20:-口-}{7:23}456789 |
+ {7:12}{20:口}{7:345}6789 |
{7:123456}^789 |
{1:~ }|
- {1:~ }|
{8:-- VISUAL BLOCK --} |
]]}
feed('Ol')
screen:expect{grid=[[
1{7:234567}89 |
1{20:-口-}{7:23}456789 |
+ 1{7:2}{20:口}{7:345}6789 |
1^2{7:34567}89 |
{1:~ }|
- {1:~ }|
{8:-- VISUAL BLOCK --} |
]]}
feed('l')
screen:expect{grid=[[
12{7:34567}89 |
1{10:-}{20:口-}{7:23}456789 |
+ 12{20:口}{7:345}6789 |
12^3{7:4567}89 |
{1:~ }|
- {1:~ }|
{8:-- VISUAL BLOCK --} |
]]}
feed('l')
screen:expect{grid=[[
123{7:4567}89 |
1{10:-}{20:口-}{7:23}456789 |
+ 12{20:口}{7:345}6789 |
123^4{7:567}89 |
{1:~ }|
- {1:~ }|
{8:-- VISUAL BLOCK --} |
]]}
end)