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
function! airline#extensions#ycm#get_error_count()
if exists(':YcmDiag')
if exists(':YcmDiag') && exists("*youcompleteme#GetErrorCount")
let cnt = youcompleteme#GetErrorCount()
if cnt != 0
@ -23,7 +23,7 @@ function! airline#extensions#ycm#get_error_count()
endfunction
function! airline#extensions#ycm#get_warning_count()
if exists(':YcmDiag')
if exists(':YcmDiag') && exists("*youcompleteme#GetWarningCount")
let cnt = youcompleteme#GetWarningCount()
if cnt != 0