fix(ui): fix incorrect highlighting when virtual text wraps with number

This commit is contained in:
Ibby 2023-04-03 23:12:56 +10:00 committed by bfredl
parent ecf225df57
commit 332b70d2ed
2 changed files with 28 additions and 1 deletions

View File

@ -1942,7 +1942,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange,
// Only restore search_attr and area_attr after "n_extra" in
// the next screen line is also done.
if (wlv.n_extra <= 0) {
if (wlv.n_extra <= 0 && wlv.saved_n_extra <= 0) {
if (search_attr == 0) {
search_attr = saved_search_attr;
}

View File

@ -1843,6 +1843,33 @@ bbbbbbb]])
|
]]}
end)
it('highlighting is correct when virtual text wraps with number', function()
insert([[
test
test]])
command('set number')
meths.buf_set_extmark(0, ns, 0, 1,
{ virt_text = { { string.rep('X', 55), 'Special' } }, virt_text_pos = 'inline', right_gravity = false })
feed('gg0')
screen:expect { grid = [[
{2: 1 }^t{28:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
{2: }{28:XXXXXXXXXX}est |
{2: 2 }test |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
|
]]}
end)
end)
describe('decorations: virtual lines', function()