populate all modes with accent colors.

This commit is contained in:
Bailey Ling
2013-09-17 22:45:12 -04:00
parent 0a6b833e7c
commit 6442f01912
7 changed files with 26 additions and 24 deletions

View File

@@ -94,6 +94,23 @@ function! airline#highlighter#add_separator(from, to, inverse)
call <sid>exec_separator({}, a:from, a:to, a:inverse, '')
endfunction
function! airline#highlighter#add_accent(group, accent)
let p = g:airline#themes#{g:airline_theme}#palette
if exists('p.accents')
if has_key(p.accents, a:accent)
for kvp in items(p)
let mode_colors = kvp[1]
if has_key(mode_colors, a:group)
let colors = copy(mode_colors[a:group])
let colors[0] = p.accents[a:accent][0]
let colors[2] = p.accents[a:accent][2]
let mode_colors[a:group.'_'.a:accent] = colors
endif
endfor
endif
endif
endfunction
function! airline#highlighter#highlight_modified_inactive(bufnr)
if getbufvar(a:bufnr, '&modified')
let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c')