mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-03-01 04:52:19 +08:00
don't throw error if bufferline is not installed
airline#extensions#load() tries to load all extensions, the user has specified in g:airline_extensions. However, if e.g. bufferline is requested to be loaded, but is not installed, it will throw an error E117: Unknown function: airline#extensions#bufferline#init Therefore, catch E117 and show a warning. closes #1127
This commit is contained in:
@@ -123,7 +123,11 @@ function! airline#extensions#load()
|
||||
|
||||
if exists('g:airline_extensions')
|
||||
for ext in g:airline_extensions
|
||||
call airline#extensions#{ext}#init(s:ext)
|
||||
try
|
||||
call airline#extensions#{ext}#init(s:ext)
|
||||
catch /^Vim\%((\a\+)\)\=:E117/ " E117, function does not exist
|
||||
call airline#util#warning("Extension '".ext."' not installed, ignoring!")
|
||||
endtry
|
||||
endfor
|
||||
return
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user