mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
fix(extmarks): fix virt_text_hide off-by-one hiding (#23795)
This commit is contained in:
parent
4dd43e31db
commit
9c41a81dec
@ -1728,7 +1728,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int mod_top, bo
|
|||||||
wlv.draw_state = WL_LINE;
|
wlv.draw_state = WL_LINE;
|
||||||
if (has_decor && wlv.row == startrow + wlv.filler_lines) {
|
if (has_decor && wlv.row == startrow + wlv.filler_lines) {
|
||||||
// hide virt_text on text hidden by 'nowrap' or 'smoothscroll'
|
// hide virt_text on text hidden by 'nowrap' or 'smoothscroll'
|
||||||
decor_redraw_col(wp, (colnr_T)(ptr - line), wlv.off, true, &decor_state);
|
decor_redraw_col(wp, (colnr_T)(ptr - line) - 1, wlv.off, true, &decor_state);
|
||||||
}
|
}
|
||||||
win_line_continue(&wlv); // use wlv.saved_ values
|
win_line_continue(&wlv); // use wlv.saved_ values
|
||||||
}
|
}
|
||||||
|
@ -837,9 +837,10 @@ describe('extmark decorations', function()
|
|||||||
screen:try_resize(50, 3)
|
screen:try_resize(50, 3)
|
||||||
command('set nowrap')
|
command('set nowrap')
|
||||||
meths.buf_set_lines(0, 0, -1, true, {'-- ' .. ('…'):rep(57)})
|
meths.buf_set_lines(0, 0, -1, true, {'-- ' .. ('…'):rep(57)})
|
||||||
|
meths.buf_set_extmark(0, ns, 0, 0, { virt_text={{'?????', 'ErrorMsg'}}, virt_text_pos='overlay', virt_text_hide=true})
|
||||||
meths.buf_set_extmark(0, ns, 0, 123, { virt_text={{'!!!!!', 'ErrorMsg'}}, virt_text_pos='overlay', virt_text_hide=true})
|
meths.buf_set_extmark(0, ns, 0, 123, { virt_text={{'!!!!!', 'ErrorMsg'}}, virt_text_pos='overlay', virt_text_hide=true})
|
||||||
screen:expect{grid=[[
|
screen:expect{grid=[[
|
||||||
^-- …………………………………………………………………………………………………………{4:!!!!!}……|
|
{4:^?????}……………………………………………………………………………………………………{4:!!!!!}……|
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
|
|
|
|
||||||
]]}
|
]]}
|
||||||
@ -849,7 +850,13 @@ describe('extmark decorations', function()
|
|||||||
{1:~ }|
|
{1:~ }|
|
||||||
|
|
|
|
||||||
]]}
|
]]}
|
||||||
feed('10zl')
|
feed('3zl')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{4:^!!!!!}……………………………… |
|
||||||
|
{1:~ }|
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
feed('7zl')
|
||||||
screen:expect{grid=[[
|
screen:expect{grid=[[
|
||||||
^………………………… |
|
^………………………… |
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
@ -858,7 +865,7 @@ describe('extmark decorations', function()
|
|||||||
|
|
||||||
command('set wrap smoothscroll')
|
command('set wrap smoothscroll')
|
||||||
screen:expect{grid=[[
|
screen:expect{grid=[[
|
||||||
-- …………………………………………………………………………………………………………{4:!!!!!}……|
|
{4:?????}……………………………………………………………………………………………………{4:!!!!!}……|
|
||||||
^………………………… |
|
^………………………… |
|
||||||
|
|
|
|
||||||
]]}
|
]]}
|
||||||
@ -876,7 +883,7 @@ describe('extmark decorations', function()
|
|||||||
]]}
|
]]}
|
||||||
feed('<C-Y>')
|
feed('<C-Y>')
|
||||||
screen:expect{grid=[[
|
screen:expect{grid=[[
|
||||||
-- …………………………………………………………………………………………………|
|
{4:?????}……………………………………………………………………………………………|
|
||||||
………{4:!!!!!}……………………………^… |
|
………{4:!!!!!}……………………………^… |
|
||||||
|
|
|
|
||||||
]]}
|
]]}
|
||||||
|
Loading…
Reference in New Issue
Block a user