fix(extmarks): draw TAB in virt_text properly with 'rl' (#25381)

This commit is contained in:
zeertzjq
2023-09-27 10:48:14 +08:00
committed by GitHub
parent de93489789
commit dfa8b582a6
2 changed files with 28 additions and 20 deletions

View File

@@ -1963,23 +1963,20 @@ describe('extmark decorations', function()
it('works with double width char and rightleft', function()
screen:try_resize(50, 3)
insert('abcdefghij口klmnop')
insert('abcdefghij口klmnopqrstu口vwx口yz')
feed('0')
command('set rightleft')
screen:expect{grid=[[
ponmlk口jihgfedcb^a|
zy口xwv口utsrqponmlk口jihgfedcb^a|
{1: ~}|
|
]]}
meths.buf_set_extmark(0, ns, 0, 2, { virt_text = {{'overlayed', 'Underlined'}}, virt_text_pos = 'overlay' })
meths.buf_set_extmark(0, ns, 0, 14, { virt_text = {{'', 'Underlined'}}, virt_text_pos = 'overlay' })
meths.buf_set_extmark(0, ns, 0, 20, { virt_text = {{'\t', 'Underlined'}}, virt_text_pos = 'overlay' })
meths.buf_set_extmark(0, ns, 0, 29, { virt_text = {{'', 'Underlined'}}, virt_text_pos = 'overlay' })
screen:expect{grid=[[
ponmlk {28:deyalrevo}b^a|
{1: ~}|
|
]]}
meths.buf_set_extmark(0, ns, 0, 15, { virt_text = {{'', 'Underlined'}}, virt_text_pos = 'overlay' })
screen:expect{grid=[[
po{28:古}lk {28:deyalrevo}b^a|
zy {28:古}wv {28: }qpon{28:古}k {28:deyalrevo}b^a|
{1: ~}|
|
]]}