extensions: prevent error about unknown function for ycm
if g:loaded_youcompleteme does not exists, the ycm extension will not be loaded. However extensions.vim could still try to init the ycm extension, which would lead to an error message: E117: unknown function airline#extensions#ycm#init so make sure, it is only loaded, if ycm is loaded as well.
This commit is contained in:
parent
2eb95b2e09
commit
76c1998753
|
@ -176,7 +176,7 @@ function! airline#extensions#load()
|
||||||
call add(s:loaded_ext, 'term')
|
call add(s:loaded_ext, 'term')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get(g:, 'airline#extensions#ycm#enabled', 0)
|
if get(g:, 'airline#extensions#ycm#enabled', 0) && exists('g:loaded_youcompleteme')
|
||||||
call airline#extensions#ycm#init(s:ext)
|
call airline#extensions#ycm#init(s:ext)
|
||||||
call add(s:loaded_ext, 'ycm')
|
call add(s:loaded_ext, 'ycm')
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue