From 889492e01c6f88bad37c1b48dd012964ee7cb184 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 25 Jan 2016 21:29:40 +0100 Subject: [PATCH] fix issue #939 --- autoload/airline/extensions/tabline.vim | 8 +++++++- doc/airline.txt | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index 7d53f17..8f2f959 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -4,7 +4,7 @@ let s:formatter = get(g:, 'airline#extensions#tabline#formatter', 'default') let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1) let s:show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1) - +let s:ignore_bufadd_pat = get(g:, 'airline#extensions#tabline#ignore_bufadd_pat', '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree') let s:taboo = get(g:, 'airline#extensions#taboo#enabled', 1) && get(g:, 'loaded_taboo', 0) if s:taboo let g:taboo_tabline = 0 @@ -38,10 +38,16 @@ function! s:toggle_on() endfunction function! s:update_tabline() + let match = expand('') if pumvisible() return elseif !get(g:, 'airline#extensions#tabline#enabled', 0) return + " return, if buffer matches ignore pattern or is directory (netrw) + elseif empty(match) + \ || match(match, s:ignore_bufadd_pat) > -1 + \ || isdirectory(expand("")) + return endif " force re-evaluation of tabline setting set mod! diff --git a/doc/airline.txt b/doc/airline.txt index 5005d3b..4ed0919 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -567,6 +567,11 @@ exposed. * configure symbol used to represent close button let g:airline#extensions#tabline#close_symbol = 'X' +* configure pattern to be ignored on BufAdd autocommand > + " fixes unneccessary redraw, when e.g. opening Gundo window + let airline#extensions#tabline#ignore_bufadd_pat = + \ '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree' + < Note: Enabling this extension will modify 'showtabline' and 'guioptions'.