Tabline: add exclude_preview option to hide preview buffer

This commit is contained in:
Enrico Ghirardi
2015-06-28 22:34:37 +02:00
parent b29e01fa22
commit 317e5fa47a
2 changed files with 8 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
" vim: et ts=2 sts=2 sw=2
let s:excludes = get(g:, 'airline#extensions#tabline#excludes', [])
let s:exclude_preview = get(g:, 'airline#extensions#tabline#exclude_preview', 1)
function! airline#extensions#tabline#buflist#invalidate()
unlet! s:current_buffer_list
@@ -26,6 +27,9 @@ function! airline#extensions#tabline#buflist#list()
if getbufvar(nr, 'current_syntax') == 'qf'
let toadd = 0
endif
if s:exclude_preview && getbufvar(nr, '&bufhidden') == 'wipe' && getbufvar(nr, '&buftype') == 'nofile'
let toadd = 0
endif
if toadd
call add(buffers, nr)
endif