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:
Christian Brabandt 2020-04-20 07:54:00 +02:00
parent 2eb95b2e09
commit 76c1998753
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 1 additions and 1 deletions

View File

@ -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