kristijanhusak / vim-hybrid-material

Material color scheme for Vim based on w0ng/vim-hybrid color scheme
MIT License
545 stars 46 forks source link

Problem with vim-gitgutter plugin #29

Closed mroavi closed 4 years ago

mroavi commented 4 years ago

Whenever I remove a line in a file tracked by git, the gitgutter plugin deletion sign does not appear on the sign column. On the other hand, the addition and modification signs are displayed correctly. I do not have this issue with any other color scheme that I use.

material-theme-bug

Here is the relevant info in the gitgutter README: https://github.com/airblade/vim-gitgutter#signs-colours-and-symbols

Could it be that you are not setting colors for these variables?

GitGutterAdd          " an added line             (default: links to DiffAdd)
GitGutterChange       " a changed line            (default: links to DiffChange)
GitGutterDelete       " at least one removed line (default: links to DiffDelete)
GitGutterChangeDelete " a changed line followed by at least one removed line (default: links to GitGutterChange)

Update: I did find that you are using these variables in colors/hybrid_material.vim:

exe "hi! DiffAdd"       .s:fg_addfg       .s:bg_addbg       .s:fmt_none
exe "hi! DiffChange"    .s:fg_changefg    .s:bg_changebg    .s:fmt_none
exe "hi! DiffDelete"    .s:fg_background  .s:bg_delbg       .s:fmt_none

But I'm not very familiar with vimscript. Any idea of what might the problem be?

This is how the same actions look with the palenight color scheme:

palenight-works

kristijanhusak commented 4 years ago

The problem is that gitgutter takes the foreground color of the DiffDelete highglight, which is in this colorscheme same as background (it's inverted, red is background color). Adding this to vimrc should do the trick:

hi link GitGutterDelete diffRemoved
mroavi commented 4 years ago

Thanks for the fix. I noticed however that this solution affects other color schemes. That means that I would have to comment out that line every time I change to another color scheme. Can you think of any other solution that would save me from doing this? If not, it's ok, I can live with it =)

kristijanhusak commented 4 years ago

You can do this:

autocmd ColorScheme hybrid_material hi link GitGutterDelete diffRemoved
mroavi commented 4 years ago

Awesome, thanks.