aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/highlight_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-01-03 00:09:35 +0100
committerJustin M. Keyes <justinkz@gmail.com>2019-01-04 01:28:44 +0100
commit37a499148ffda85a089042b4879fa0182c116f9f (patch)
treef17d73b2ecd502a2c30f8140a2f344da5012b348 /test/functional/ui/highlight_spec.lua
parente2d71d11de9282521e931d832a92154acd341ef0 (diff)
downloadrneovim-37a499148ffda85a089042b4879fa0182c116f9f.tar.gz
rneovim-37a499148ffda85a089042b4879fa0182c116f9f.tar.bz2
rneovim-37a499148ffda85a089042b4879fa0182c116f9f.zip
Visual: highlight char-at-cursor
Decide whether to highlight the visual-selected character under the cursor, depending on 'guicursor' style: - Highlight if cursor is blinking or non-block (vertical, horiz). - Do NOT highlight if cursor is non-blinking block. Traditionally Vim's visual selection does "reverse mode", which perhaps conflicts with the non-blinking block cursor. But 'guicursor' defaults to a vertical bar for selection=exclusive, and this confuses users who expect to see the text highlighted. closes #8983
Diffstat (limited to 'test/functional/ui/highlight_spec.lua')
-rw-r--r--test/functional/ui/highlight_spec.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua
index 96f6b43320..39170337d7 100644
--- a/test/functional/ui/highlight_spec.lua
+++ b/test/functional/ui/highlight_spec.lua
@@ -322,6 +322,40 @@ describe('highlight', function()
screen:attach()
end)
+ it('visual', function()
+ screen:detach()
+ screen = Screen.new(20,4)
+ screen:attach()
+ screen:set_default_attr_ids({
+ [1] = {background = Screen.colors.LightGrey},
+ [2] = {bold = true, foreground = Screen.colors.Blue1},
+ [3] = {bold = true},
+ })
+ insert([[
+ line1 foo bar
+ ]])
+
+ -- Non-blinking block cursor: does NOT highlight char-at-cursor.
+ command('set guicursor=a:block-blinkon0')
+ feed('gg$vhhh')
+ screen:expect([[
+ line1 foo^ {1:bar} |
+ |
+ {2:~ }|
+ {3:-- VISUAL --} |
+ ]])
+
+ -- Vertical cursor: highlights char-at-cursor. #8983
+ command('set guicursor=a:block-blinkon175')
+ feed('<esc>gg$vhhh')
+ screen:expect([[
+ line1 foo{1:^ bar} |
+ |
+ {2:~ }|
+ {3:-- VISUAL --} |
+ ]])
+ end)
+
it('cterm=standout gui=standout', function()
screen:detach()
screen = Screen.new(20,5)