update tabline on bufadd events

This commit is contained in:
Christian Brabandt 2016-01-21 10:00:06 +01:00
parent 17eff4f4b0
commit 8ae46e989d
1 changed files with 15 additions and 0 deletions

View File

@ -37,6 +37,18 @@ function! s:toggle_on()
set tabline=%!airline#extensions#tabline#get() set tabline=%!airline#extensions#tabline#get()
endfunction 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) function! airline#extensions#tabline#load_theme(palette)
let colors = get(a:palette, 'tabline', {}) let colors = get(a:palette, 'tabline', {})
let l:tab = get(colors, 'airline_tab', a:palette.normal.airline_b) 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() call airline#extensions#tabline#buffers#invalidate()
endif endif
if !exists('#airline#BufAdd#*')
autocmd airline BufAdd * call <sid>update_tabline()
endif
if s:show_buffers && curtabcnt == 1 || !s:show_tabs if s:show_buffers && curtabcnt == 1 || !s:show_tabs
return airline#extensions#tabline#buffers#get() return airline#extensions#tabline#buffers#get()
else else