diff --git a/autoload/airline.vim b/autoload/airline.vim index d7b2b13a..5f2b540a 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -122,18 +122,24 @@ 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 - for winnr in range(1, winnr('$')) - if winnr != a:winnr - \ && has_key(s:contexts, winnr) - \ && s:contexts[winnr].bufnr == context.bufnr - call airline#highlighter#exec('airline_c'.(context.bufnr).'_inactive', colors) - endif - endfor + if !empty(colors) + for winnr in range(1, winnr('$')) + if winnr != a:winnr + \ && has_key(s:contexts, winnr) + \ && s:contexts[winnr].bufnr == context.bufnr + call airline#highlighter#exec('airline_c'.(context.bufnr).'_inactive', colors) + endif + endfor + endif endif if g:airline_detect_paste && &paste