implement funcref list again, this time with a global function as this affects older versions of vim

This commit is contained in:
Bailey Ling 2013-07-09 13:48:57 +00:00
parent 65664efe13
commit 40b99e181d
3 changed files with 20 additions and 19 deletions

View File

@ -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()

View File

@ -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

View File

@ -50,6 +50,8 @@ function! s:init()
endif
endfunction
let g:airline_window_override_funcrefs = []
augroup airline
au!
autocmd ColorScheme * call airline#highlight(['normal'])