mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
fix(drawline): fix missing Visual hl on double-width fold char (#24308)
This commit is contained in:
parent
19fb573ad9
commit
06694203e5
@ -1805,9 +1805,11 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl
|
|||||||
&& (area_highlighting || spv->spv_has_spell || extra_check)) {
|
&& (area_highlighting || spv->spv_has_spell || extra_check)) {
|
||||||
// handle Visual or match highlighting in this line
|
// handle Visual or match highlighting in this line
|
||||||
if (wlv.vcol == wlv.fromcol
|
if (wlv.vcol == wlv.fromcol
|
||||||
|| (wlv.vcol + 1 == wlv.fromcol && wlv.n_extra == 0
|
|| (wlv.vcol + 1 == wlv.fromcol
|
||||||
&& utf_ptr2cells(ptr) > 1)
|
&& ((wlv.n_extra == 0 && utf_ptr2cells(ptr) > 1)
|
||||||
|| ((int)vcol_prev == fromcol_prev
|
|| (wlv.n_extra > 0 && wlv.p_extra != NULL
|
||||||
|
&& utf_ptr2cells(wlv.p_extra) > 1)))
|
||||||
|
|| (vcol_prev == fromcol_prev
|
||||||
&& vcol_prev < wlv.vcol // not at margin
|
&& vcol_prev < wlv.vcol // not at margin
|
||||||
&& wlv.vcol < wlv.tocol)) {
|
&& wlv.vcol < wlv.tocol)) {
|
||||||
area_attr = vi_attr; // start highlighting
|
area_attr = vi_attr; // start highlighting
|
||||||
|
@ -2509,18 +2509,18 @@ describe("folded lines", function()
|
|||||||
it('Folded and Visual highlights are combined #19691', function()
|
it('Folded and Visual highlights are combined #19691', function()
|
||||||
command('hi! Visual guibg=Red')
|
command('hi! Visual guibg=Red')
|
||||||
insert([[
|
insert([[
|
||||||
" foo
|
" foofoofoofoofoofoo
|
||||||
" {{{1
|
" 口 {{{1
|
||||||
set nocp
|
set nocp
|
||||||
" }}}1
|
" }}}1
|
||||||
" bar
|
" barbarbarbarbarbar
|
||||||
" {{{1
|
" 口 {{{1
|
||||||
set foldmethod=marker
|
set foldmethod=marker
|
||||||
" }}}1
|
" }}}1
|
||||||
" baz]])
|
" bazbazbazbazbazbaz]])
|
||||||
feed('gg')
|
feed('gg')
|
||||||
command('source')
|
command('source')
|
||||||
feed('<C-V>G3l')
|
feed('<C-V>G15l')
|
||||||
if multigrid then
|
if multigrid then
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
## grid 1
|
## grid 1
|
||||||
@ -2533,11 +2533,11 @@ describe("folded lines", function()
|
|||||||
[2:---------------------------------------------]|
|
[2:---------------------------------------------]|
|
||||||
[3:---------------------------------------------]|
|
[3:---------------------------------------------]|
|
||||||
## grid 2
|
## grid 2
|
||||||
{14:" fo}o |
|
{14:" foofoofoofoofo}ofoo |
|
||||||
{15:+-- }{5: 3 lines: "······························}|
|
{15:+-- 3 lines: " }{5:口···························}|
|
||||||
{14:" ba}r |
|
{14:" barbarbarbarba}rbar |
|
||||||
{15:+-- }{5: 3 lines: "······························}|
|
{15:+-- 3 lines: " }{5:口···························}|
|
||||||
{14:" b}^az |
|
{14:" bazbazbazbazb}^azbaz |
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
## grid 3
|
## grid 3
|
||||||
@ -2545,11 +2545,191 @@ describe("folded lines", function()
|
|||||||
]])
|
]])
|
||||||
else
|
else
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{14:" fo}o |
|
{14:" foofoofoofoofo}ofoo |
|
||||||
{15:+-- }{5: 3 lines: "······························}|
|
{15:+-- 3 lines: " }{5:口···························}|
|
||||||
{14:" ba}r |
|
{14:" barbarbarbarba}rbar |
|
||||||
{15:+-- }{5: 3 lines: "······························}|
|
{15:+-- 3 lines: " }{5:口···························}|
|
||||||
{14:" b}^az |
|
{14:" bazbazbazbazb}^azbaz |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{11:-- VISUAL BLOCK --} |
|
||||||
|
]])
|
||||||
|
end
|
||||||
|
|
||||||
|
feed('l')
|
||||||
|
if multigrid then
|
||||||
|
screen:expect([[
|
||||||
|
## grid 1
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[3:---------------------------------------------]|
|
||||||
|
## grid 2
|
||||||
|
{14:" foofoofoofoofoo}foo |
|
||||||
|
{15:+-- 3 lines: " 口}{5:···························}|
|
||||||
|
{14:" barbarbarbarbar}bar |
|
||||||
|
{15:+-- 3 lines: " 口}{5:···························}|
|
||||||
|
{14:" bazbazbazbazba}^zbaz |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
## grid 3
|
||||||
|
{11:-- VISUAL BLOCK --} |
|
||||||
|
]])
|
||||||
|
else
|
||||||
|
screen:expect([[
|
||||||
|
{14:" foofoofoofoofoo}foo |
|
||||||
|
{15:+-- 3 lines: " 口}{5:···························}|
|
||||||
|
{14:" barbarbarbarbar}bar |
|
||||||
|
{15:+-- 3 lines: " 口}{5:···························}|
|
||||||
|
{14:" bazbazbazbazba}^zbaz |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{11:-- VISUAL BLOCK --} |
|
||||||
|
]])
|
||||||
|
end
|
||||||
|
|
||||||
|
feed('l')
|
||||||
|
if multigrid then
|
||||||
|
screen:expect([[
|
||||||
|
## grid 1
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[3:---------------------------------------------]|
|
||||||
|
## grid 2
|
||||||
|
{14:" foofoofoofoofoof}oo |
|
||||||
|
{15:+-- 3 lines: " 口}{5:···························}|
|
||||||
|
{14:" barbarbarbarbarb}ar |
|
||||||
|
{15:+-- 3 lines: " 口}{5:···························}|
|
||||||
|
{14:" bazbazbazbazbaz}^baz |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
## grid 3
|
||||||
|
{11:-- VISUAL BLOCK --} |
|
||||||
|
]])
|
||||||
|
else
|
||||||
|
screen:expect([[
|
||||||
|
{14:" foofoofoofoofoof}oo |
|
||||||
|
{15:+-- 3 lines: " 口}{5:···························}|
|
||||||
|
{14:" barbarbarbarbarb}ar |
|
||||||
|
{15:+-- 3 lines: " 口}{5:···························}|
|
||||||
|
{14:" bazbazbazbazbaz}^baz |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{11:-- VISUAL BLOCK --} |
|
||||||
|
]])
|
||||||
|
end
|
||||||
|
|
||||||
|
feed('2l')
|
||||||
|
if multigrid then
|
||||||
|
screen:expect([[
|
||||||
|
## grid 1
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[3:---------------------------------------------]|
|
||||||
|
## grid 2
|
||||||
|
{14:" foofoofoofoofoofoo} |
|
||||||
|
{15:+-- 3 lines: " 口··}{5:·························}|
|
||||||
|
{14:" barbarbarbarbarbar} |
|
||||||
|
{15:+-- 3 lines: " 口··}{5:·························}|
|
||||||
|
{14:" bazbazbazbazbazba}^z |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
## grid 3
|
||||||
|
{11:-- VISUAL BLOCK --} |
|
||||||
|
]])
|
||||||
|
else
|
||||||
|
screen:expect([[
|
||||||
|
{14:" foofoofoofoofoofoo} |
|
||||||
|
{15:+-- 3 lines: " 口··}{5:·························}|
|
||||||
|
{14:" barbarbarbarbarbar} |
|
||||||
|
{15:+-- 3 lines: " 口··}{5:·························}|
|
||||||
|
{14:" bazbazbazbazbazba}^z |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{11:-- VISUAL BLOCK --} |
|
||||||
|
]])
|
||||||
|
end
|
||||||
|
|
||||||
|
feed('O16l')
|
||||||
|
if multigrid then
|
||||||
|
screen:expect([[
|
||||||
|
## grid 1
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[3:---------------------------------------------]|
|
||||||
|
## grid 2
|
||||||
|
" foofoofoofoofo{14:ofoo} |
|
||||||
|
{5:+-- 3 lines: " }{15:口··}{5:·························}|
|
||||||
|
" barbarbarbarba{14:rbar} |
|
||||||
|
{5:+-- 3 lines: " }{15:口··}{5:·························}|
|
||||||
|
" bazbazbazbazba^z{14:baz} |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
## grid 3
|
||||||
|
{11:-- VISUAL BLOCK --} |
|
||||||
|
]])
|
||||||
|
else
|
||||||
|
screen:expect([[
|
||||||
|
" foofoofoofoofo{14:ofoo} |
|
||||||
|
{5:+-- 3 lines: " }{15:口··}{5:·························}|
|
||||||
|
" barbarbarbarba{14:rbar} |
|
||||||
|
{5:+-- 3 lines: " }{15:口··}{5:·························}|
|
||||||
|
" bazbazbazbazba^z{14:baz} |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{11:-- VISUAL BLOCK --} |
|
||||||
|
]])
|
||||||
|
end
|
||||||
|
|
||||||
|
feed('l')
|
||||||
|
if multigrid then
|
||||||
|
screen:expect([[
|
||||||
|
## grid 1
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[2:---------------------------------------------]|
|
||||||
|
[3:---------------------------------------------]|
|
||||||
|
## grid 2
|
||||||
|
" foofoofoofoofoo{14:foo} |
|
||||||
|
{5:+-- 3 lines: " }{15:口··}{5:·························}|
|
||||||
|
" barbarbarbarbar{14:bar} |
|
||||||
|
{5:+-- 3 lines: " }{15:口··}{5:·························}|
|
||||||
|
" bazbazbazbazbaz^b{14:az} |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
## grid 3
|
||||||
|
{11:-- VISUAL BLOCK --} |
|
||||||
|
]])
|
||||||
|
else
|
||||||
|
screen:expect([[
|
||||||
|
" foofoofoofoofoo{14:foo} |
|
||||||
|
{5:+-- 3 lines: " }{15:口··}{5:·························}|
|
||||||
|
" barbarbarbarbar{14:bar} |
|
||||||
|
{5:+-- 3 lines: " }{15:口··}{5:·························}|
|
||||||
|
" bazbazbazbazbaz^b{14:az} |
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
{11:-- VISUAL BLOCK --} |
|
{11:-- VISUAL BLOCK --} |
|
||||||
|
Loading…
Reference in New Issue
Block a user