From 8ae46e989dbe0ca6c0f7ceb0ea7a55e1433ebb9f Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Thu, 21 Jan 2016 10:00:06 +0100 Subject: [PATCH] update tabline on bufadd events --- autoload/airline/extensions/tabline.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index d36da9f9..7d53f173 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -37,6 +37,18 @@ function! s:toggle_on() set tabline=%!airline#extensions#tabline#get() endfunction +function! s:update_tabline() + if pumvisible() + return + elseif !get(g:, 'airline#extensions#tabline#enabled', 0) + return + endif + " force re-evaluation of tabline setting + set mod! + redraw + set mod! +endfunction + function! airline#extensions#tabline#load_theme(palette) let colors = get(a:palette, 'tabline', {}) let l:tab = get(colors, 'airline_tab', a:palette.normal.airline_b) @@ -70,6 +82,9 @@ function! airline#extensions#tabline#get() call airline#extensions#tabline#buffers#invalidate() endif + if !exists('#airline#BufAdd#*') + autocmd airline BufAdd * call update_tabline() + endif if s:show_buffers && curtabcnt == 1 || !s:show_tabs return airline#extensions#tabline#buffers#get() else