From 317e5fa47a2799523440b13ede73973218134e26 Mon Sep 17 00:00:00 2001 From: Enrico Ghirardi Date: Sun, 28 Jun 2015 22:34:37 +0200 Subject: [PATCH] Tabline: add exclude_preview option to hide preview buffer --- autoload/airline/extensions/tabline/buflist.vim | 4 ++++ doc/airline.txt | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/tabline/buflist.vim b/autoload/airline/extensions/tabline/buflist.vim index 95873ba6..1b5d216a 100644 --- a/autoload/airline/extensions/tabline/buflist.vim +++ b/autoload/airline/extensions/tabline/buflist.vim @@ -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 diff --git a/doc/airline.txt b/doc/airline.txt index c61b7f29..c78ad03a 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -446,7 +446,10 @@ eclim < * configure filename match rules to exclude from the tabline. > let g:airline#extensions#tabline#excludes = [] -< + +* enable/disable display preview window buffer in the tabline. + let g:airline#extensions#tabline#exclude_preview = 1 + * configure how numbers are displayed in tab mode. > let g:airline#extensions#tabline#tab_nr_type = 0 " # of splits (default) let g:airline#extensions#tabline#tab_nr_type = 1 " tab number