From f8645fb65441bce9d4ba20e22f3addc10c47d1a5 Mon Sep 17 00:00:00 2001 From: maek Date: Mon, 10 Nov 2014 15:25:09 +0100 Subject: [PATCH] Improve tabline + buffer_min_count behaviour Use BufEnter and BufUnload in place of CursorMoved. Fixes #479 --- autoload/airline/extensions/tabline.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index 60d4a66..bbab057 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -62,9 +62,10 @@ function! s:toggle_on() augroup airline_tabline autocmd! if s:show_buffers == 1 - autocmd CursorMoved * call on_cursormove(s:buf_min_count, len(s:get_buffer_list())) + autocmd BufEnter * call show_tabline(s:buf_min_count, len(s:get_buffer_list())) + autocmd BufUnload * call show_tabline(s:buf_min_count, len(s:get_buffer_list()) - 1) else - autocmd TabEnter * call on_cursormove(s:tab_min_count, tabpagenr('$')) + autocmd TabEnter * call show_tabline(s:tab_min_count, tabpagenr('$')) endif augroup END endif @@ -94,7 +95,7 @@ function! airline#extensions#tabline#load_theme(palette) call airline#highlighter#exec('airline_tabhid', l:tabhid) endfunction -function! s:on_cursormove(min_count, total_count) +function! s:show_tabline(min_count, total_count) if a:total_count >= a:min_count if &showtabline != 2 set showtabline=2