fix error on startup in certain configurations (#150).

This commit is contained in:
Bailey Ling 2013-08-18 18:13:34 +00:00
parent 0a88fd81d3
commit 60dd8ed0a8
1 changed files with 8 additions and 3 deletions

View File

@ -70,20 +70,25 @@ call s:check_defined('g:airline_section_warning', '')
let s:airline_initialized = 0
let s:airline_theme_defined = 0
function! s:on_window_changed()
function! s:init()
if !s:airline_initialized
let s:airline_initialized = 1
call airline#extensions#load()
let s:airline_theme_defined = exists('g:airline_theme')
let g:airline_theme = get(g:, 'airline_theme', 'dark')
call <sid>on_colorscheme_changed()
let s:airline_initialized = 1
endif
endfunction
function! s:on_window_changed()
call <sid>init()
call airline#update_statusline()
endfunction
function! s:on_colorscheme_changed()
call <sid>init()
if !s:airline_theme_defined
if airline#switch_matching_theme()
return