vim-patch:9.0.0179: cursor pos wrong with wrapping virtual text in empty line

Problem:    Cursor position wrong with wrapping virtual text in empty line.
Solution:   Adjust handling of an empty line. (closes vim/vim#10875)

49a90792d9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Ibby
2023-03-26 14:49:09 +11:00
committed by bfredl
parent 8eaf3c4f8c
commit 43c2eaada2
3 changed files with 125 additions and 12 deletions

View File

@@ -1390,6 +1390,92 @@ end]]
|
]]}
end)
it('text is drawn correctly when inserting a wrapping virtual text on an empty line', function()
feed('o<esc>')
insert([[aaaaaaa
bbbbbbb]])
meths.buf_set_extmark(0, ns, 0, 0,
{ virt_text = { { string.rep('X', 51), 'Special' } }, virt_text_pos = 'inline' })
meths.buf_set_extmark(0, ns, 2, 0,
{ virt_text = { { string.rep('X', 50), 'Special' } }, virt_text_pos = 'inline' })
feed('gg0')
screen:expect { grid = [[
{28:^XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
{28:X} |
aaaaaaa |
{28:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
bbbbbbb |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
|
]]}
feed('j')
screen:expect { grid = [[
{28:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
{28:X} |
^aaaaaaa |
{28:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
bbbbbbb |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
|
]]}
feed('j')
screen:expect { grid = [[
{28:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
{28:X} |
aaaaaaa |
{28:^XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
bbbbbbb |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
|
]]}
feed('j')
screen:expect { grid = [[
{28:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
{28:X} |
aaaaaaa |
{28:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
^bbbbbbb |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
|
]]}
end)
end)
describe('decorations: virtual lines', function()