diff --git a/autoload/airline.vim b/autoload/airline.vim index 108e8b9..dfc93e0 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -68,7 +68,9 @@ function! s:apply_window_overrides() let w:airline_section_c = bufname(winbufnr(winnr())) endif - call airline#extensions#apply_window_overrides() + for FuncRef in g:airline_window_override_funcrefs + call FuncRef() + endfor endfunction function! airline#update_externals() diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index 23c97ac..a335db0 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -1,23 +1,5 @@ let s:sections = ['a','b','c','gutter','x','y','z'] -function! airline#extensions#load() - let g:unite_force_overwrite_statusline = 0 - - if exists('g:loaded_ctrlp') && g:loaded_ctrlp - 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', - \ } - endif -endfunction - -function! s:empty_sections() - for section in s:sections - let w:airline_section_{section} = '' - endfor -endfunction - function! s:override_left_only(section1, section2) let w:airline_section_a = a:section1 let w:airline_section_b = a:section2 @@ -49,3 +31,18 @@ function! airline#extensions#apply_window_overrides() call s:override_left_only('MiniBufExplorer', '') endif endfunction + +function! airline#extensions#load() + let g:unite_force_overwrite_statusline = 0 + + if exists('g:loaded_ctrlp') && g:loaded_ctrlp + 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', + \ } + endif + + call add(g:airline_window_override_funcrefs, function('airline#extensions#apply_window_overrides')) +endfunction + diff --git a/plugin/airline.vim b/plugin/airline.vim index 1827a77..ebe3a5d 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -50,6 +50,8 @@ function! s:init() endif endfunction +let g:airline_window_override_funcrefs = [] + augroup airline au! autocmd ColorScheme * call airline#highlight(['normal'])