diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-17 18:09:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-17 18:09:29 +0800 |
commit | 08986bb5972d5289b5ae581eee20c56387cf5ddd (patch) | |
tree | 0327f96a2c6e756f0f9504b4ada3bea86cfd3af1 | |
parent | 091eb4c8c7208569379daf094503abd2eeec32c6 (diff) | |
download | rneovim-08986bb5972d5289b5ae581eee20c56387cf5ddd.tar.gz rneovim-08986bb5972d5289b5ae581eee20c56387cf5ddd.tar.bz2 rneovim-08986bb5972d5289b5ae581eee20c56387cf5ddd.zip |
test: combining TermCursorNC with CursorLine/CursorColumn (#27898)
-rw-r--r-- | test/functional/terminal/highlight_spec.lua | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/functional/terminal/highlight_spec.lua b/test/functional/terminal/highlight_spec.lua index 98d760d1ee..241c3e5a71 100644 --- a/test/functional/terminal/highlight_spec.lua +++ b/test/functional/terminal/highlight_spec.lua @@ -197,6 +197,8 @@ it('CursorLine and CursorColumn work in :terminal buffer in Normal mode', functi [1] = { background = Screen.colors.Grey90 }, -- CursorLine, CursorColumn [2] = { reverse = true }, -- TermCursor [3] = { bold = true }, -- ModeMsg + [4] = { background = Screen.colors.Grey90, reverse = true }, + [5] = { background = Screen.colors.Red }, }) screen:attach() 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 }| | ]]) + -- 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) describe(':terminal highlight forwarding', function() |