mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
screen: fix vcol counting with virtual text. Fixes #9941
This commit is contained in:
parent
afd576ee94
commit
828a6e7568
@ -4007,7 +4007,7 @@ win_line (
|
||||
break;
|
||||
}
|
||||
|
||||
++vcol;
|
||||
vcol += cells;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,9 @@ describe('Buffer highlighting', function()
|
||||
[14] = {background = Screen.colors.Gray90},
|
||||
[15] = {background = Screen.colors.Gray90, bold = true, foreground = Screen.colors.Brown},
|
||||
[16] = {foreground = Screen.colors.Magenta, background = Screen.colors.Gray90},
|
||||
[17] = {foreground = Screen.colors.Magenta, background = Screen.colors.LightRed},
|
||||
[18] = {background = Screen.colors.LightRed},
|
||||
[19] = {foreground = Screen.colors.Blue1, background = Screen.colors.LightRed},
|
||||
})
|
||||
end)
|
||||
|
||||
@ -516,6 +519,32 @@ describe('Buffer highlighting', function()
|
||||
|
|
||||
]])
|
||||
end)
|
||||
|
||||
it('works with color column', function()
|
||||
eq(-1, set_virtual_text(-1, 3, {{"暗x事", "Comment"}}, {}))
|
||||
screen:expect{grid=[[
|
||||
^1 + 2 {3:=}{2: 3} |
|
||||
3 + {11:ERROR:} invalid syntax |
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
|
||||
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
|
||||
x = 4 {12:暗x事} |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
|
|
||||
]]}
|
||||
|
||||
command("set colorcolumn=9")
|
||||
screen:expect{grid=[[
|
||||
^1 + 2 {3:=}{2: }{17:3} |
|
||||
3 + {11:ERROR:} invalid syntax |
|
||||
5, 5, 5,{18: }5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
|
||||
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
|
||||
x = 4 {12:暗}{19:x}{12:事} |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
|
|
||||
]]}
|
||||
end)
|
||||
end)
|
||||
|
||||
it('and virtual text use the same namespace counter', function()
|
||||
|
Loading…
Reference in New Issue
Block a user