From 8867301f78caf816690c7e00c5285e8ecd63b432 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 4 Feb 2019 08:23:58 +0100 Subject: [PATCH] plugin: Move tabline_update function to autoload --- autoload/airline.vim | 6 ++++++ plugin/airline.vim | 14 ++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index 3c4a054..a7b4fe8 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -265,3 +265,9 @@ function! airline#check_mode(winnr) return '' endfunction + +function! airline#update_tabline() + if get(g:, 'airline_statusline_ontop', 0) + call airline#extensions#tabline#redraw() + endif +endfunction diff --git a/plugin/airline.vim b/plugin/airline.vim index 491a853..cc45d51 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -59,15 +59,9 @@ endfunction function! s:on_cursor_moved() if winnr() != s:active_winnr - call on_window_changed() - endif - call update_tabline() -endfunction - -function! s:update_tabline() - if get(g:, 'airline_statusline_ontop', 0) - call airline#extensions#tabline#redraw() + call s:on_window_changed() endif + call airline#update_tabline() endfunction function! s:on_colorscheme_changed() @@ -154,7 +148,7 @@ function! s:airline_toggle() if get(g:, 'airline_statusline_ontop', 0) " Force update of tabline more often - autocmd InsertEnter,InsertLeave,CursorMovedI * :call update_tabline() + autocmd InsertEnter,InsertLeave,CursorMovedI * :call airline#update_tabline() endif augroup END @@ -193,7 +187,7 @@ function! s:airline_refresh() call airline#highlighter#reset_hlcache() call airline#load_theme() call airline#update_statusline() - call s:update_tabline() + call airline#update_tabline() endfunction function! s:FocusGainedHandler(timer)