mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-04-08 19:35:31 +02:00
move helper functions into update statusline, they're not used anywhere else
This commit is contained in:
parent
1d07110af3
commit
c655bdc233
@ -52,25 +52,6 @@ function! airline#highlight(modes)
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:is_excluded_window()
|
|
||||||
for Fn in g:airline_exclude_funcrefs
|
|
||||||
if Fn()
|
|
||||||
return 1
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
return 0
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:apply_window_overrides()
|
|
||||||
unlet! w:airline_left_only
|
|
||||||
for section in s:sections
|
|
||||||
unlet! w:airline_section_{section}
|
|
||||||
endfor
|
|
||||||
for Fn in g:airline_window_override_funcrefs
|
|
||||||
call Fn()
|
|
||||||
endfor
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! airline#update_externals()
|
function! airline#update_externals()
|
||||||
let g:airline_externals_bufferline = g:airline_enable_bufferline && exists('*bufferline#get_status_string')
|
let g:airline_externals_bufferline = g:airline_enable_bufferline && exists('*bufferline#get_status_string')
|
||||||
\ ? '%{bufferline#refresh_status()}'.bufferline#get_status_string() : "%f%m"
|
\ ? '%{bufferline#refresh_status()}'.bufferline#get_status_string() : "%f%m"
|
||||||
@ -87,8 +68,8 @@ function! airline#update_externals()
|
|||||||
\ ? '%(%{tagbar#currenttag("%s","")} '.g:airline_right_alt_sep.' %)' : ''
|
\ ? '%(%{tagbar#currenttag("%s","")} '.g:airline_right_alt_sep.' %)' : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" for 7.2 compatibility
|
||||||
function! s:getwinvar(winnr, key, ...)
|
function! s:getwinvar(winnr, key, ...)
|
||||||
" for 7.2 compatibility
|
|
||||||
let winvals = getwinvar(a:winnr, '')
|
let winvals = getwinvar(a:winnr, '')
|
||||||
return get(winvals, a:key, (a:0 ? a:1 : ''))
|
return get(winvals, a:key, (a:0 ? a:1 : ''))
|
||||||
endfunction
|
endfunction
|
||||||
@ -141,14 +122,22 @@ function! s:get_statusline(winnr, active)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#update_statusline()
|
function! airline#update_statusline()
|
||||||
let w:airline_active = 1
|
for Fn in g:airline_exclude_funcrefs
|
||||||
if s:is_excluded_window()
|
if Fn()
|
||||||
call setwinvar(winnr(), '&statusline', '')
|
call setwinvar(winnr(), '&statusline', '')
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
call airline#update_externals()
|
unlet! w:airline_left_only
|
||||||
call s:apply_window_overrides()
|
for section in s:sections
|
||||||
|
unlet! w:airline_section_{section}
|
||||||
|
endfor
|
||||||
|
for Fn in g:airline_window_override_funcrefs
|
||||||
|
call Fn()
|
||||||
|
endfor
|
||||||
|
|
||||||
|
let w:airline_active = 1
|
||||||
call setwinvar(winnr(), '&statusline', s:get_statusline(winnr(), 1))
|
call setwinvar(winnr(), '&statusline', s:get_statusline(winnr(), 1))
|
||||||
|
|
||||||
for nr in range(1, winnr('$'))
|
for nr in range(1, winnr('$'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user