Merge pull request #1201 from chrisbra/ycm

call YCM function only if they are defined
This commit is contained in:
Christian Brabandt 2016-07-01 11:54:09 +02:00 committed by GitHub
commit fadd737a29

View File

@ -11,7 +11,7 @@ function! airline#extensions#ycm#init(ext)
endfunction endfunction
function! airline#extensions#ycm#get_error_count() function! airline#extensions#ycm#get_error_count()
if exists(':YcmDiag') if exists(':YcmDiag') && exists("*youcompleteme#GetErrorCount")
let cnt = youcompleteme#GetErrorCount() let cnt = youcompleteme#GetErrorCount()
if cnt != 0 if cnt != 0
@ -23,7 +23,7 @@ function! airline#extensions#ycm#get_error_count()
endfunction endfunction
function! airline#extensions#ycm#get_warning_count() function! airline#extensions#ycm#get_warning_count()
if exists(':YcmDiag') if exists(':YcmDiag') && exists("*youcompleteme#GetWarningCount")
let cnt = youcompleteme#GetWarningCount() let cnt = youcompleteme#GetWarningCount()
if cnt != 0 if cnt != 0