Merge pull request #1138 from chrisbra/1127

don't throw error if bufferline is not installed
This commit is contained in:
Christian Brabandt 2016-04-21 09:41:47 +02:00
commit 86e7d19df1
2 changed files with 11 additions and 1 deletions

View File

@ -123,7 +123,11 @@ function! airline#extensions#load()
if exists('g:airline_extensions') if exists('g:airline_extensions')
for ext in g:airline_extensions for ext in g:airline_extensions
try
call airline#extensions#{ext}#init(s:ext) 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 endfor
return return
endif endif

View File

@ -19,6 +19,12 @@ function! airline#util#append(text, minwidth)
return empty(a:text) ? '' : prefix.g:airline_left_alt_sep.s:spc.a:text return empty(a:text) ? '' : prefix.g:airline_left_alt_sep.s:spc.a:text
endfunction endfunction
function! airline#util#warning(msg)
echohl WarningMsg
echomsg "airline: ".a:msg
echohl Normal
endfunction
function! airline#util#prepend(text, minwidth) function! airline#util#prepend(text, minwidth)
if a:minwidth > 0 && winwidth(0) < a:minwidth if a:minwidth > 0 && winwidth(0) < a:minwidth
return '' return ''