Open sloria opened 8 years ago
You're right. Both the foreground and background colors you have there are not the intended Error colors.
The foreground color for Errors should be the same dark gray or black depending on the sierra mode being used. And the red should always be cterm color 131
and hex color #af5f5f
.
Can you please, open vim with sierra running and type:
:hi Error
and read my back the output
As far as I can tell Error are displaying correctly on my end.
I'm using vim 7.5.1831 with sierra v3.0.0 inside of iTerm build 3.0.7 Here are some examples.
Here is the output of :hi Error
:
I am using vim 7.4.2275 in iterm 3.0.7 with sierra installed via vim-colorschemes. I also tried installing the latest master version of sierra from this repo, but I still see the same problem.
I even tried changing my terminal colors to use sierra_Midnight.Xresources, and that actually made it worse!
@sloria that was a good idea using the Xresources. Even though it is obviously broken when using the midnight palette, it leads me to believe that something in Vim is referencing the terminal colors and not sierra's internal highlight Error colors. My guess is that a plugin is responsible, but that's just my guess.
Try changing the Xresources color9 to the value below or from the iTerm preferences > profiles > colors > change Bright Red #9 to hex #000000
! red *.color9: #000000
@AlessandroYorba Ah, your hypothesis is confirmed: when I changed Bright Red #9 to #000000, the Error highlight color becomes black.
I am unsure what the culprit is; I have only seen this happen when using sierra.
FWIW, I'm seeing the same issue when I use Alduin.
@sloria after the change, was the foreground color black or the background black? Same thing with Alduin and Sierra probably because color1 and color 9 share the same value. Whatever it is that is calling the Errors it's using both color1 and color9 for foreground and background. What was the terminal theme used in your first screenshot?
The background color became black.
Here is the theme I am using in the screen shot: https://gist.github.com/sloria/655377de989353d8d9083a01eacaf85b
Thank you @sloria , so far I believe that a plugin is responsible.
ANSI Colors
.color1
used for foreground
.color9
used for the background
Since I cannot override the plugin from my end, I can offer a workaround. Here are the colors for your iTerm theme that should show errors similar to the Visual highlight you liked in your first post.
*.color1: #dfdfaf
*.color9: #875f5f
@AlessandroYorba I tried disabling all plugins except for vim-colorschemes
and the syntax checker (khuno) and commented all the settings in my vimrc, and the issue still persists. Even if I change the syntax-checking plugin to Syntastic, the colors are still incorrect, so it seems unlikely that a plugin is the culprit. Though I'm open to ideas for further diagnosing the issue.
@sloria good call. I will continue to look at this via documentation and I'll also check other more popular and older color schemes to see if this issue has come up. Let's leave this ticket open for others who might have a solution.
In addition to iTerm2, I have confirmed the issue also exists in Terminal.app. The issue also exists regardless of whether I am using zsh or bash.
Let's see if we can find out what highlighting group vim is using. Add this to your .vimrc:
nmap <C-S-P> :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
Then pull up the file and once the Error highlighting is active, place your cursor over any word within the Error. Then from your keyboard click:
Control + Shift + p
At the bottom of vim in the messaging area all of the highlighting groups should be listed. Let's see what highlighting groups were found.
The output after hitting C-S-P
is
['pythonString']
When using sierra in the terminal, the highlighting color for errors has very low contrast against the text, making the text very hard to read.
Perhaps you could use colors that are similar to search result highlighting, like "BaseModel" in this screenshot: