plugin: Move tabline_update function to autoload

This commit is contained in:
Christian Brabandt 2019-02-04 08:23:58 +01:00
parent 840bf02baf
commit 8867301f78
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 10 additions and 10 deletions

View File

@ -265,3 +265,9 @@ function! airline#check_mode(winnr)
return '' return ''
endfunction endfunction
function! airline#update_tabline()
if get(g:, 'airline_statusline_ontop', 0)
call airline#extensions#tabline#redraw()
endif
endfunction

View File

@ -59,15 +59,9 @@ endfunction
function! s:on_cursor_moved() function! s:on_cursor_moved()
if winnr() != s:active_winnr if winnr() != s:active_winnr
call <sid>on_window_changed() call s:on_window_changed()
endif
call <sid>update_tabline()
endfunction
function! s:update_tabline()
if get(g:, 'airline_statusline_ontop', 0)
call airline#extensions#tabline#redraw()
endif endif
call airline#update_tabline()
endfunction endfunction
function! s:on_colorscheme_changed() function! s:on_colorscheme_changed()
@ -154,7 +148,7 @@ function! s:airline_toggle()
if get(g:, 'airline_statusline_ontop', 0) if get(g:, 'airline_statusline_ontop', 0)
" Force update of tabline more often " Force update of tabline more often
autocmd InsertEnter,InsertLeave,CursorMovedI * :call <sid>update_tabline() autocmd InsertEnter,InsertLeave,CursorMovedI * :call airline#update_tabline()
endif endif
augroup END augroup END
@ -193,7 +187,7 @@ function! s:airline_refresh()
call airline#highlighter#reset_hlcache() call airline#highlighter#reset_hlcache()
call airline#load_theme() call airline#load_theme()
call airline#update_statusline() call airline#update_statusline()
call s:update_tabline() call airline#update_tabline()
endfunction endfunction
function! s:FocusGainedHandler(timer) function! s:FocusGainedHandler(timer)