mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
fix(extmarks): hide inline virt_text properly with 'smoothscroll' (#24106)
This commit is contained in:
parent
958cc22836
commit
f4f1ce1d16
@ -1525,7 +1525,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl
|
|||||||
|
|
||||||
// If there the text doesn't reach to the desired column, need to skip
|
// If there the text doesn't reach to the desired column, need to skip
|
||||||
// "skip_cells" cells when virtual text follows.
|
// "skip_cells" cells when virtual text follows.
|
||||||
if (!wp->w_p_wrap && v > wlv.vcol) {
|
if ((!wp->w_p_wrap || (lnum == wp->w_topline && wp->w_skipcol > 0)) && v > wlv.vcol) {
|
||||||
wlv.skip_cells = (int)(v - wlv.vcol);
|
wlv.skip_cells = (int)(v - wlv.vcol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2316,6 +2316,38 @@ bbbbbbb]])
|
|||||||
]]}
|
]]}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('smoothscroll works correctly when virtual text wraps', function()
|
||||||
|
insert('foobar')
|
||||||
|
meths.buf_set_extmark(0, ns, 0, 3,
|
||||||
|
{ virt_text = { { string.rep('X', 55), 'Special' } }, virt_text_pos = 'inline' })
|
||||||
|
command('setlocal smoothscroll')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
foo{10:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
|
||||||
|
{10:XXXXXXXX}ba^r |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
feed('<C-E>')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{1:<<<}{10:XXXXX}ba^r |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
end)
|
||||||
|
|
||||||
it('in diff mode is highlighted correct', function()
|
it('in diff mode is highlighted correct', function()
|
||||||
insert([[
|
insert([[
|
||||||
9000
|
9000
|
||||||
|
Loading…
Reference in New Issue
Block a user