diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index 93f2b9c..25f47ec 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -138,7 +138,9 @@ function! airline#extensions#load() call airline#extensions#netrw#init(s:ext) endif - call airline#extensions#ycm#init(s:ext) + if exists(':YcmDiag') + call airline#extensions#ycm#init(s:ext) + endif if get(g:, 'loaded_vimfiler', 0) let g:vimfiler_force_overwrite_statusline = 0 diff --git a/autoload/airline/extensions/default.vim b/autoload/airline/extensions/default.vim index 8129ec9..9060ec3 100644 --- a/autoload/airline/extensions/default.vim +++ b/autoload/airline/extensions/default.vim @@ -37,6 +37,9 @@ if v:version >= 704 || (v:version >= 703 && has('patch81')) function s:add_section(builder, context, key) " i have no idea why the warning section needs special treatment, but it's " needed to prevent separators from showing up + if ((a:key == 'error' || a:key == 'warning') && empty(s:get_section(a:context.winnr, a:key))) + return + endif if (a:key == 'warning' || a:key == 'error') call a:builder.add_raw('%(') endif diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index 255bd95..500daae 100644 --- a/autoload/airline/init.vim +++ b/autoload/airline/init.vim @@ -84,7 +84,8 @@ function! airline#init#bootstrap() \ 'raw': '%{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#', \ 'accent': 'bold'}) call airline#parts#define_function('ffenc', 'airline#parts#ffenc') - call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'eclim', 'whitespace','windowswap']) + call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', + \ 'eclim', 'whitespace','windowswap', 'ycm_error_count', 'ycm_warning_count']) call airline#parts#define_text('capslock', '') unlet g:airline#init#bootstrapping