diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-01-09 19:16:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-09 19:16:44 +0800 |
commit | d54156ed08b84e6c7f22334a4f3a4d4f84798604 (patch) | |
tree | ef9eb02cfb299095a50f8b39d3c17eb100bfe1b5 /test/functional/ui/decorations_spec.lua | |
parent | b2c92eebc01c15789b37c6f62bd71a6ccfd0155f (diff) | |
download | rneovim-d54156ed08b84e6c7f22334a4f3a4d4f84798604.tar.gz rneovim-d54156ed08b84e6c7f22334a4f3a4d4f84798604.tar.bz2 rneovim-d54156ed08b84e6c7f22334a4f3a4d4f84798604.zip |
fix(extmarks): blending space shouldn't overwrite wide char (#26960)
Diffstat (limited to 'test/functional/ui/decorations_spec.lua')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index 4860009e38..d6a0205b7e 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -2112,6 +2112,43 @@ describe('extmark decorations', function() ]]} end) + it('virtual text blending space does not overwrite double-width char', function() + screen:try_resize(50, 3) + insert('abcdefghij口klmnopqrstu口vwx口yz') + feed('0') + command('hi Blendy guibg=Red blend=30') + meths.buf_set_extmark(0, ns, 0, 0, { virt_text = {{' ! ! ', 'Blendy'}}, virt_text_win_col = 8, hl_mode = 'blend' }) + screen:expect{grid=[[ + ^abcdefgh{10:i}{7:!}{10:口}{7:!}{10:l}mnopqrstu口vwx口yz | + {1:~ }| + | + ]]} + feed('x') + screen:expect{grid=[[ + ^bcdefghi{10:j}{7:!}{10: k}{7:!}{10:m}nopqrstu口vwx口yz | + {1:~ }| + | + ]]} + feed('x') + screen:expect{grid=[[ + ^cdefghij{10: }{7:!}{10:kl}{7:!}{10:n}opqrstu口vwx口yz | + {1:~ }| + | + ]]} + feed('x') + screen:expect{grid=[[ + ^defghij口{7:!}{10:lm}{7:!}{10:o}pqrstu口vwx口yz | + {1:~ }| + | + ]]} + feed('7x') + screen:expect{grid=[[ + ^口klmnop{10:q}{7:!}{10:st}{7:!}{10:口}vwx口yz | + {1:~ }| + | + ]]} + end) + it('virtual text works with double-width char and rightleft', function() screen:try_resize(50, 3) insert('abcdefghij口klmnopqrstu口vwx口yz') |