From d1ee91eadf5aada19f56d09e9f8e6c06e9caaf0f Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sat, 27 Jul 2013 14:02:43 +0000 Subject: [PATCH] update the ctrlp theme when the airline theme changes --- autoload/airline.vim | 1 + autoload/airline/extensions.vim | 15 ++++++++++++--- autoload/airline/extensions/ctrlp.vim | 3 +-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index faf33611..f1c8f641 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -33,6 +33,7 @@ function! airline#load_theme(name) let w:airline_lastmode = '' call airline#highlight(['inactive']) call airline#update_highlight() + call airline#extensions#load_theme() endfunction function! airline#highlight(modes) diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index b91ee0c4..f3272a95 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -69,12 +69,21 @@ function! airline#extensions#is_excluded_window() return 0 endfunction +function! airline#extensions#load_theme() + if get(g:, 'loaded_ctrlp', 0) + call airline#extensions#ctrlp#load_theme() + endif +endfunction + function! airline#extensions#load() - let g:unite_force_overwrite_statusline = 0 - let g:vimfiler_force_overwrite_statusline = 0 + if get(g:, 'loaded_unite', 0) + let g:unite_force_overwrite_statusline = 0 + endif + if get(g:, 'loaded_vimfiler', 0) + let g:vimfiler_force_overwrite_statusline = 0 + endif if get(g:, 'loaded_ctrlp', 0) - call airline#extensions#ctrlp#load_ctrlp_hi() let g:ctrlp_status_func = { \ 'main': 'airline#extensions#ctrlp#ctrlp_airline', \ 'prog': 'airline#extensions#ctrlp#ctrlp_airline_status', diff --git a/autoload/airline/extensions/ctrlp.vim b/autoload/airline/extensions/ctrlp.vim index c9105861..3348c3c7 100644 --- a/autoload/airline/extensions/ctrlp.vim +++ b/autoload/airline/extensions/ctrlp.vim @@ -1,5 +1,4 @@ -function! airline#extensions#ctrlp#load_ctrlp_hi() - let load_theme = g:airline#themes#{g:airline_theme}#normal +function! airline#extensions#ctrlp#load_theme() if exists('g:airline#themes#{g:airline_theme}#ctrlp') let theme = g:airline#themes#{g:airline_theme}#ctrlp else