check existence of inactive modified colors before using them.

This commit is contained in:
Bailey Ling 2013-09-05 21:01:08 +00:00
parent 3c49b9cf3d
commit 46db9b9bdf
1 changed files with 15 additions and 9 deletions

View File

@ -122,11 +122,16 @@ function! airline#check_mode(winnr)
if g:airline_detect_modified
if &modified
call add(l:mode, 'modified')
let colors = g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c
let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c')
\ ? g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c
\ : []
else
let colors = g:airline#themes#{g:airline_theme}#palette.inactive.airline_c
let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c')
\ ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c
\ : []
endif
if !empty(colors)
for winnr in range(1, winnr('$'))
if winnr != a:winnr
\ && has_key(s:contexts, winnr)
@ -135,6 +140,7 @@ function! airline#check_mode(winnr)
endif
endfor
endif
endif
if g:airline_detect_paste && &paste
call add(l:mode, 'paste')