mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-25 09:41:33 +08:00
themes: correctly catch not-found in init function
plugin/airline.vim was calling airline#switch_theme() without actually catching the 'not-found' exception. Therefore, in case of errors, explicitly switch to a dark theme. closes #1903
This commit is contained in:
parent
773f0e3637
commit
d1d9548b8e
|
@ -29,7 +29,13 @@ function! s:init()
|
|||
call airline#util#warning(printf('Could not resolve airline theme "%s". Themes have been migrated to github.com/vim-airline/vim-airline-themes.', g:airline_theme))
|
||||
let g:airline_theme = 'dark'
|
||||
endtry
|
||||
silent call airline#switch_theme(g:airline_theme)
|
||||
try
|
||||
silent call airline#switch_theme(g:airline_theme)
|
||||
catch
|
||||
call airline#util#warning(printf('Could not find airline theme "%s".', g:airline_theme))
|
||||
let g:airline_theme = 'dark'
|
||||
silent call airline#switch_theme(g:airline_theme)
|
||||
endtry
|
||||
else
|
||||
let g:airline_theme = 'dark'
|
||||
silent call s:on_colorscheme_changed()
|
||||
|
|
Loading…
Reference in New Issue
Block a user