fix(ui): fix overflowing nowrap virtual text not displaying if tab follows

This commit is contained in:
Ibby 2023-04-20 02:15:49 +10:00 committed by bfredl
parent 34d862942c
commit a37c990483
2 changed files with 33 additions and 0 deletions

View File

@ -1799,6 +1799,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange,
area_attr = 0;
extmark_attr = 0;
virt_inline_i++;
n_skip = 0;
// If the text didn't reach until the first window
// column we need to skip cells.
if (skip_cells > 0) {

View File

@ -1983,6 +1983,38 @@ bbbbbbb]])
|
]]}
end)
it('correctly draws when overflowing virtual text is followed by tab with no wrap', function()
command('set nowrap')
feed('i<TAB>test<ESC>')
meths.buf_set_extmark(
0,
ns,
0,
0,
{ virt_text = { { string.rep('a', 60), 'Special' } }, virt_text_pos = 'inline' }
)
feed('0')
screen:expect({
grid = [[
{28:aaaaaaaaaaaaaaaaaaaaaa} ^ test |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
|
]],
})
end)
end)
describe('decorations: virtual lines', function()