qvacua / vimr

VimR — Neovim GUI for macOS in Swift
https://twitter.com/VimRefined
MIT License
6.66k stars 218 forks source link

Cursor background changes with text foreground #758

Open ljohnston opened 4 years ago

ljohnston commented 4 years ago

Hi,

As can be seen in these screenshots, the VimR's cursor background color changes based on cursor position and the underlying character's foreground color.

image image

Note that when the cursor is not on any visible character, the cursor background is the expected color.

image

Thanks for providing a neovim GUI for OS X... I just started using it and it's awesome!

Regards, Lance

nfd commented 4 years ago

Just to pile on here, this means that the cursor disappears entirely on highlight sections where guifg=bg. I use this in my org-mode-inspired thing to mark subheading markers as invisible.

smackesey commented 4 years ago

I believe the color-switching behavior isn't a bug or VimR-specific, but is due to the settings of the cursor highlight group:

hi Cursor
cterm=reverse gui=reverse

It's the reverse that triggers color switching of foreground and background. But it seems to not always work correctly, specifically in syntax groups (like Search) where guibg is set, it fails to set the text color correctly.