tabline: fix cache invalidation for show_buffers=1 with `:bd`

Ref: https://github.com/bling/vim-airline/pull/700#issuecomment-73798679
This commit is contained in:
Daniel Hahler 2015-02-11 00:31:39 +01:00
parent b6accd91c8
commit 98c2dbd04e
1 changed files with 6 additions and 5 deletions

View File

@ -61,9 +61,6 @@ function! s:toggle_on()
set tabline=%!airline#extensions#tabline#get()
augroup airline_tabline
autocmd!
" Invalidate cache.
autocmd BufAdd,BufUnload * unlet! s:current_buffer_list
if s:buf_min_count <= 0 && s:tab_min_count <= 1
set showtabline=2
else
@ -74,6 +71,10 @@ function! s:toggle_on()
autocmd TabEnter * call <sid>show_tabline(s:tab_min_count, tabpagenr('$'))
endif
endif
" Invalidate cache. This has to come after the BufUnload for
" s:show_buffers, to invalidate the cache for BufEnter.
autocmd BufAdd,BufUnload * unlet! s:current_buffer_list
augroup END
endfunction