Safety: Make sure g:airline_theme is defined before using it

fixes #1624
This commit is contained in:
Christian Brabandt 2018-01-04 23:54:12 +01:00
parent a90ac37cb3
commit c76019ac9e
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 1 additions and 0 deletions

View File

@ -34,6 +34,7 @@ function! airline#add_inactive_statusline_func(name)
endfunction endfunction
function! airline#load_theme() function! airline#load_theme()
let g:airline_theme = get(g:, 'airline_theme', 'dark')
if exists('*airline#themes#{g:airline_theme}#refresh') if exists('*airline#themes#{g:airline_theme}#refresh')
call airline#themes#{g:airline_theme}#refresh() call airline#themes#{g:airline_theme}#refresh()
endif endif