diff --git a/autoload/airline/extensions/ycm.vim b/autoload/airline/extensions/ycm.vim index 9b6d486a..f7ba4d7b 100644 --- a/autoload/airline/extensions/ycm.vim +++ b/autoload/airline/extensions/ycm.vim @@ -1,8 +1,13 @@ " MIT License. Copyright (c) 2015-2019 Evgeny Firsov et al. +" Plugin: https://github.com/ycm-core/YouCompleteMe " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 +if !exists('g:loaded_youcompleteme') + finish +endif + let s:spc = g:airline_symbols.space let s:error_symbol = get(g:, 'airline#extensions#ycm#error_symbol', 'E:') let s:warning_symbol = get(g:, 'airline#extensions#ycm#warning_symbol', 'W:') @@ -12,8 +17,8 @@ function! airline#extensions#ycm#init(ext) call airline#parts#define_function('ycm_warning_count', 'airline#extensions#ycm#get_warning_count') endfunction -function! airline#extensions#ycm#get_error_count() - if exists(':YcmDiag') && exists("*youcompleteme#GetErrorCount") +function! airline#extensions#ycm#get_error_count() abort + if exists("*youcompleteme#GetErrorCount") let cnt = youcompleteme#GetErrorCount() if cnt != 0 @@ -25,7 +30,7 @@ function! airline#extensions#ycm#get_error_count() endfunction function! airline#extensions#ycm#get_warning_count() - if exists(':YcmDiag') && exists("*youcompleteme#GetWarningCount") + if exists("*youcompleteme#GetWarningCount") let cnt = youcompleteme#GetWarningCount() if cnt != 0 diff --git a/doc/airline.txt b/doc/airline.txt index ea21d1b6..de7b924f 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -1517,7 +1517,7 @@ be updated automatically. Either re-enter the tab or press two times. \ airline#extensions#tabline#xtabline#prev_buffer(v:count) : "\" ------------------------------------- *airline-ycm* -YouCompleteMe +YouCompleteMe Shows number of errors and warnings in the current file detected by YCM.