mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-06 12:14:24 +08:00
extract tabline colors from the current palette.
This commit is contained in:
@@ -14,15 +14,15 @@ function! airline#extensions#ctrlp#generate_color_map(dark, light, white)
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ctrlp#load_theme()
|
||||
if exists('g:airline#themes#{g:airline_theme}#palette.ctrlp')
|
||||
let theme = g:airline#themes#{g:airline_theme}#palette.ctrlp
|
||||
function! airline#extensions#ctrlp#load_theme(palette)
|
||||
if exists('a:palette.ctrlp')
|
||||
let theme = a:palette.ctrlp
|
||||
else
|
||||
let s:color_template = has_key(g:airline#themes#{g:airline_theme}#palette, s:color_template) ? s:color_template : 'insert'
|
||||
let s:color_template = has_key(a:palette, s:color_template) ? s:color_template : 'insert'
|
||||
let theme = airline#extensions#ctrlp#generate_color_map(
|
||||
\ g:airline#themes#{g:airline_theme}#palette[s:color_template]['airline_c'],
|
||||
\ g:airline#themes#{g:airline_theme}#palette[s:color_template]['airline_b'],
|
||||
\ g:airline#themes#{g:airline_theme}#palette[s:color_template]['airline_a'])
|
||||
\ a:palette[s:color_template]['airline_c'],
|
||||
\ a:palette[s:color_template]['airline_b'],
|
||||
\ a:palette[s:color_template]['airline_a'])
|
||||
endif
|
||||
for key in keys(theme)
|
||||
call airline#highlighter#exec(key, theme[key])
|
||||
@@ -60,5 +60,6 @@ function! airline#extensions#ctrlp#init(ext)
|
||||
\ 'prog': 'airline#extensions#ctrlp#ctrlp_airline_status',
|
||||
\ }
|
||||
call a:ext.add_statusline_func('airline#extensions#ctrlp#apply')
|
||||
call a:ext.add_theme_func('airline#extensions#ctrlp#load_theme')
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user