invoke funcrefs a different way, resolves #115.
This commit is contained in:
parent
4ae9484075
commit
238ab44489
@ -104,21 +104,29 @@ function! s:get_statusline(winnr, active)
|
|||||||
return sl
|
return sl
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#update_statusline()
|
function! s:exec_funcrefs(list, break_early)
|
||||||
for i in range(0, len(g:airline_exclude_funcrefs) - 1)
|
" for 7.2; we cannot iterate list, hence why we use range()
|
||||||
if g:airline_exclude_funcrefs[i]()
|
" for 7.3-[97, 328]; we cannot reuse the variable, hence the {}
|
||||||
call setwinvar(winnr(), '&statusline', '')
|
for i in range(0, len(a:list) - 1)
|
||||||
return
|
let Fn{i} = a:list[i]
|
||||||
|
if Fn{i}() && a:break_early
|
||||||
|
return 1
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! airline#update_statusline()
|
||||||
|
if s:exec_funcrefs(g:airline_exclude_funcrefs, 1)
|
||||||
|
call setwinvar(winnr(), '&statusline', '')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
unlet! w:airline_left_only
|
unlet! w:airline_left_only
|
||||||
for section in s:sections
|
for section in s:sections
|
||||||
unlet! w:airline_section_{section}
|
unlet! w:airline_section_{section}
|
||||||
endfor
|
endfor
|
||||||
for i in range(0, len(g:airline_statusline_funcrefs) - 1)
|
call s:exec_funcrefs(g:airline_statusline_funcrefs, 0)
|
||||||
call g:airline_statusline_funcrefs[i]()
|
|
||||||
endfor
|
|
||||||
|
|
||||||
let w:airline_active = 1
|
let w:airline_active = 1
|
||||||
call setwinvar(winnr(), '&statusline', s:get_statusline(winnr(), 1))
|
call setwinvar(winnr(), '&statusline', s:get_statusline(winnr(), 1))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user