mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-30 08:04:22 +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:
@@ -19,6 +19,12 @@ function! airline#util#append(text, minwidth)
|
||||
return empty(a:text) ? '' : prefix.g:airline_left_alt_sep.s:spc.a:text
|
||||
endfunction
|
||||
|
||||
function! airline#util#warning(msg)
|
||||
echohl WarningMsg
|
||||
echomsg "airline: ".a:msg
|
||||
echohl Normal
|
||||
endfunction
|
||||
|
||||
function! airline#util#prepend(text, minwidth)
|
||||
if a:minwidth > 0 && winwidth(0) < a:minwidth
|
||||
return ''
|
||||
|
||||
Reference in New Issue
Block a user