morhetz / gruvbox

Retro groove color scheme for Vim
13.78k stars 1.1k forks source link

YouCompleteMe diagnostics coloring are not handled properly #292

Open dvdesolve opened 5 years ago

dvdesolve commented 5 years ago

I use YouCompleteMe plugin for vim and gruvbox theme with dark background. My .vimrc:

"" load and set extra plugins
let &runtimepath.=','.$PLUMED_VIMPATH
let g:ycm_extra_conf_globlist = ['~/radiotechnics/*']
let g:ycm_use_clangd = 0
let g:ycm_clangd_binary_path = '/usr/bin/clangd'

"" disable vi compatibility
set nocompatible

"" save backups
set backup

"" enable modelines
set modeline
set modelines=5

"" interface
set number
set laststatus=2
set statusline=%#DiffAdd#%F%h%m%r%=%#DiffChange#[%Y\ \|\ %{&fenc}/%{&ff}]\ [%l/%L,%v]\ [%p%%]%*
set showmode
set showcmd

"" fast scrolling
set ttyfast

"" search settings
set hlsearch
set incsearch
set ignorecase
set smartcase

"" tabulation
set expandtab
set tabstop=4
set shiftwidth=4
set smarttab

"" indentation
filetype plugin indent on
set autoindent
set smartindent

"" paste toggle mode
nnoremap <F2> :set invpaste paste?<CR>
set pastetoggle=<F2>

"" coloring
set termguicolors
let g:gruvbox_italic=1
colorscheme gruvbox
set background=dark

"" syntax highlighting
syntax on

"" wrapping
set wrap
set linebreak

"" don't store global options in sessions
set ssop-=options

"" menu staff
set wildmenu
set wcm=<TAB>

"" line endings menu
menu Endings.DOS :e++ff=dos<CR>
menu Endings.UNIX :e++ff=unix<CR>
menu Endings.MAC :e++ff=mac<CR>
imap <F7> <ESC>:emenu Endings.<TAB>
nmap <F7> :emenu Endings.<TAB>

"" encoding menu
menu Encoding.UTF-8 :e++enc=utf8<CR>
menu Encoding.KOI8-R :e++enc=koi8-r<CR>
menu Encoding.CP1251 :e++enc=cp1251<CR>
menu Encoding.CP866 :e++enc=cp866<CR>
imap <F8> <ESC>:emenu Encoding.<TAB>
nmap <F8> :emenu Encoding.<TAB>

"" build menu
menu Build.all :make<CR>
menu Build.isp :make isp<CR>
menu Build.clean :make clean<CR>
menu Build.install :make install<CR>
menu Build.uninstall :make uninstall<CR>
imap <F9> <ESC>:emenu Build.<TAB>
nmap <F9> :emenu Build.<TAB>

"" save key
imap <F2> <ESC>:w<CR><INSERT>
vmap <F2> <ESC>:w<CR><INSERT>
nmap <F2> :w<CR>

YCM supports on-the-fly diagnostics and marking problematic lines with left gutter symbol (which works just fine) and highlighting background for erroneous syntax. Let's consider the following example:

#include <stdio.h>

int main(int argc, char *argv[]) {
    int test_var = 42;

    printf("Hello, world!\ntest_var = %d\n", test_var); /* this is a comment for test_var */

    return 0;
}

With default color scheme (I mean all gruvbox-related lines under coloring subsection in .vimrc are commented out) I get the following result: def_hl Erroneous syntax is highlighted properly (the same true for left gutter symbol). However, if gruvbox color theme is enabled then I have no background highlighting neither for erroneous phrase nor for gutter symbol: gruvbox_hl

May gruvbox have troubles with related groups?

(see also ycm-core/YouCompleteMe#3473 for extra info)

dvdesolve commented 5 years ago

Seems like in current gruvbox theme SyntasticErrorSign and SyntasticWarningSign have no background color, SyntasticErrorLine and SyntasticWarningLine doesn't exist at all and SyntasticError and SyntasticWarning also have no background.

Is it possible to officially implement these colors?

dvdesolve commented 5 years ago

ping

Climax777 commented 4 years ago

@morhetz can this be merged?