mirror of
https://github.com/vim-airline/vim-airline-themes.git
synced 2025-02-21 07:42:55 +08:00
use list of funcrecs, allowing window overrides to be dynamically added
This commit is contained in:
parent
0c394308e4
commit
c0427e435d
@ -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()
|
||||
|
@ -10,12 +10,8 @@ function! airline#extensions#load()
|
||||
\ 'prog': 'airline#extensions#ctrlp#ctrlp_airline_status',
|
||||
\ }
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:empty_sections()
|
||||
for section in s:sections
|
||||
let w:airline_section_{section} = ''
|
||||
endfor
|
||||
call add(g:airline_window_override_funcrefs, function('s:apply_window_overrides'))
|
||||
endfunction
|
||||
|
||||
function! s:override_left_only(section1, section2)
|
||||
@ -25,7 +21,7 @@ function! s:override_left_only(section1, section2)
|
||||
let w:airline_left_only = 1
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#apply_window_overrides()
|
||||
function! s:apply_window_overrides()
|
||||
silent! unlet w:airline_left_only
|
||||
for section in s:sections
|
||||
silent! unlet w:airline_section_{section}
|
||||
|
@ -50,6 +50,8 @@ function! s:init()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let g:airline_window_override_funcrefs = []
|
||||
|
||||
augroup airline
|
||||
au!
|
||||
autocmd ColorScheme * call airline#highlight(['normal'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user