diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index fd39aa0..770597e 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -129,7 +129,7 @@ function! airline#extensions#load() call airline#extensions#tagbar#init(s:ext) endif - if g:airline_enable_csv && exists(':Table') + if g:airline_enable_csv && (get(g:, 'loaded_csv', 0) || exists(':Table')) call airline#extensions#csv#init(s:ext) endif diff --git a/plugin/airline.vim b/plugin/airline.vim index c8153be..89c388a 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -83,13 +83,14 @@ function! s:airline_toggle() else let s:stl = &stl augroup airline - autocmd! - autocmd ColorScheme * call airline#reload_highlight() - autocmd WinEnter,BufWinEnter,FileType,BufUnload,ShellCmdPost * - \ call on_window_changed() + autocmd! + autocmd ColorScheme * call airline#reload_highlight() + autocmd WinEnter,BufWinEnter,FileType,BufUnload,ShellCmdPost * + \ call on_window_changed() augroup END - " update statusline now - call on_window_changed() + if s:airline_initialized + call on_window_changed() + endif endif endfunction