tabline: Ignore buffers in buflist matching ignore_bufadd_pat

closes #1777
This commit is contained in:
Christian Brabandt 2018-09-20 10:26:32 +02:00
parent a60eabb82f
commit 012229fe08
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 7 additions and 4 deletions

View File

@ -48,8 +48,6 @@ function! s:update_tabline()
return
endif
let match = expand('<afile>')
let ignore_bufadd_pat = get(g:, 'airline#extensions#tabline#ignore_bufadd_pat',
\ '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree|startify')
if pumvisible()
return
elseif !get(g:, 'airline#extensions#tabline#enabled', 0)

View File

@ -36,6 +36,7 @@ function! airline#extensions#tabline#buflist#list()
let exclude_buffers = get(g:, 'airline#extensions#tabline#exclude_buffers', [])
let exclude_paths = get(g:, 'airline#extensions#tabline#excludes', [])
let exclude_preview = get(g:, 'airline#extensions#tabline#exclude_preview', 1)
let exclude_types = get(g:, 'g:airline#extensions#tabline#ignore_bufadd_pat', [])
let list = (exists('g:did_bufmru') && g:did_bufmru) ? BufMRUList() : range(1, bufnr("$"))
@ -52,14 +53,18 @@ function! airline#extensions#tabline#buflist#list()
" 4) when excluding preview windows:
" 'bufhidden' == wipe
" 'buftype' == nofile
" 5) ignore buffers matching airline#extensions#tabline#ignore_bufadd_pat
" check buffer numbers first
if index(exclude_buffers, nr) >= 0
continue
" check paths second
" check paths second
elseif !empty(exclude_paths) && s:ExcludePaths(nr, exclude_paths)
continue
" check other types last
" ignore buffers matching airline#extensions#tabline#ignore_bufadd_pat
elseif airline#util#ignore_buf(bufname(nr))
continue
" check other types last
elseif s:ExcludeOther(nr, exclude_preview)
continue
endif