From cdc951be363f6d4cb4efd7ccbdb9104430dc8de6 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sun, 22 Sep 2013 17:20:38 -0400 Subject: [PATCH] bufenter is sufficient to detect buffer list changes. --- autoload/airline/extensions/tabline.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index c6623ab..37f21a8 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -28,9 +28,9 @@ function! airline#extensions#tabline#init(ext) set showtabline=2 else if s:show_buffers == 1 - autocmd CursorMoved * call cursormove(s:buf_min_count, len(s:get_buffer_list())) + autocmd BufEnter * call on_buf_enter(s:buf_min_count, len(s:get_buffer_list())) else - autocmd CursorMoved * call cursormove(s:tab_min_count, tabpagenr('$')) + autocmd BufEnter * call on_buf_enter(s:tab_min_count, tabpagenr('$')) endif endif @@ -53,7 +53,7 @@ function! airline#extensions#tabline#load_theme(palette) call airline#highlighter#exec('airline_tabhid', l:tabhid) endfunction -function! s:cursormove(min_count, total_count) +function! s:on_buf_enter(min_count, total_count) if a:total_count >= a:min_count if &showtabline != 2 set showtabline=2