test: combining TermCursorNC with CursorLine/CursorColumn (#27898)

This commit is contained in:
zeertzjq 2024-03-17 18:09:29 +08:00 committed by GitHub
parent 091eb4c8c7
commit 08986bb597
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -197,6 +197,8 @@ it('CursorLine and CursorColumn work in :terminal buffer in Normal mode', functi
[1] = { background = Screen.colors.Grey90 }, -- CursorLine, CursorColumn [1] = { background = Screen.colors.Grey90 }, -- CursorLine, CursorColumn
[2] = { reverse = true }, -- TermCursor [2] = { reverse = true }, -- TermCursor
[3] = { bold = true }, -- ModeMsg [3] = { bold = true }, -- ModeMsg
[4] = { background = Screen.colors.Grey90, reverse = true },
[5] = { background = Screen.colors.Red },
}) })
screen:attach() screen:attach()
command(("enew | call termopen(['%s'])"):format(testprg('tty-test'))) command(("enew | call termopen(['%s'])"):format(testprg('tty-test')))
@ -247,6 +249,48 @@ it('CursorLine and CursorColumn work in :terminal buffer in Normal mode', functi
{1:bar fooba^r }| {1:bar fooba^r }|
| |
]]) ]])
-- CursorLine and CursorColumn are combined with TermCursorNC.
command('highlight TermCursorNC gui=reverse')
screen:expect([[
tty ready{1: } |
foobar f{1:o}obar foobar foobar foobar foobar foobar |
foobar fo{1:o}bar foobar foobar foobar foobar foobar f|
oobar foo{1:b}ar foobar foobar foobar foobar foobar fo|
obar foob{1:a}r foobar foobar foobar foobar foobar foo|
{1:bar fooba^r}{4: }{1: }|
|
]])
feed('2gg11|')
screen:expect([[
tty ready {1: } |
{1: foobar fo^obar foobar foobar foobar foobar foobar }|
foobar foo{1:b}ar foobar foobar foobar foobar foobar f|
oobar foob{1:a}r foobar foobar foobar foobar foobar fo|
obar fooba{1:r} foobar foobar foobar foobar foobar foo|
bar foobar{4: } |
|
]])
-- TermCursorNC has higher precedence.
command('highlight TermCursorNC gui=NONE guibg=Red')
screen:expect([[
tty ready {1: } |
{1: foobar fo^obar foobar foobar foobar foobar foobar }|
foobar foo{1:b}ar foobar foobar foobar foobar foobar f|
oobar foob{1:a}r foobar foobar foobar foobar foobar fo|
obar fooba{1:r} foobar foobar foobar foobar foobar foo|
bar foobar{5: } |
|
]])
feed('G$')
screen:expect([[
tty ready{1: } |
foobar f{1:o}obar foobar foobar foobar foobar foobar |
foobar fo{1:o}bar foobar foobar foobar foobar foobar f|
oobar foo{1:b}ar foobar foobar foobar foobar foobar fo|
obar foob{1:a}r foobar foobar foobar foobar foobar foo|
{1:bar fooba^r}{5: }{1: }|
|
]])
end) end)
describe(':terminal highlight forwarding', function() describe(':terminal highlight forwarding', function()