mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user