From b84e5485221096dc8c2bbc18f130e52265b367cc Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sat, 16 Mar 2019 09:32:18 +0100 Subject: [PATCH] Make displaying the tab count optional Set the g:airline#extensions#tabline#show_tab_count to zero to disable. fixes complaints at #1882 --- autoload/airline/extensions/tabline.vim | 2 +- doc/airline.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index ff87e1b8..04890555 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -231,7 +231,7 @@ function! airline#extensions#tabline#add_label(dict, type) endfunction function! airline#extensions#tabline#add_tab_label(dict) - if tabpagenr('$') > 1 + if get(g:, 'airline#extensions#tabline#show_tab_count', 1) && tabpagenr('$') > 1 call a:dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$'))) endif endfunction diff --git a/doc/airline.txt b/doc/airline.txt index 7507ab59..cbe2947d 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -813,6 +813,9 @@ with the middle mouse button to delete that buffer. * enable/disable displaying tabs, regardless of number. (c) > let g:airline#extensions#tabline#show_tabs = 1 + +* enable/disable displaying number of tabs in the right side (c) > + let g:airline#extensions#tabline#show_tab_count = 1 < * configure filename match rules to exclude from the tabline. > let g:airline#extensions#tabline#excludes = []