mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
fix(ui): fix incorrect highlighting when virtual text wraps with number
This commit is contained in:
parent
ecf225df57
commit
332b70d2ed
@ -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;
|
||||
}
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user