AlessandroYorba / Sierra

A Vim Colorscheme
298 stars 22 forks source link

Request: Improve error highlighting #4

Open sloria opened 8 years ago

sloria commented 8 years ago

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.

tmux

Perhaps you could use colors that are similar to search result highlighting, like "BaseModel" in this screenshot:

tmux

AlessandroYorba commented 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.
1 2 3 4 5

sloria commented 8 years ago

Here is the output of :hi Error:

tmux

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.

sloria commented 8 years ago

I even tried changing my terminal colors to use sierra_Midnight.Xresources, and that actually made it worse!

tmux

tmux

AlessandroYorba commented 8 years ago

@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

sloria commented 8 years ago

@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.

sloria commented 8 years ago

FWIW, I'm seeing the same issue when I use Alduin.

AlessandroYorba commented 8 years ago

@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?

sloria commented 8 years ago

The background color became black.

Here is the theme I am using in the screen shot: https://gist.github.com/sloria/655377de989353d8d9083a01eacaf85b

AlessandroYorba commented 8 years ago

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

sloria commented 8 years ago

@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.

AlessandroYorba commented 8 years ago

@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.

sloria commented 8 years ago

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.

AlessandroYorba commented 8 years ago

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.

sloria commented 8 years ago

The output after hitting C-S-P is

['pythonString']