diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index adeb283d..24c1a956 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -251,7 +251,10 @@ function! airline#extensions#tabline#add_label(dict, type, right) endfunction function! airline#extensions#tabline#add_tab_label(dict) - if get(g:, 'airline#extensions#tabline#show_tab_count', 1) && tabpagenr('$') > 1 + let show_tab_count = get(g:, 'airline#extensions#tabline#show_tab_conut', 1) + if show_tab_count == 2 + call a:dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$'))) + elseif 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 fb65c0ec..247f60f8 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -956,6 +956,11 @@ with the middle mouse button to delete that buffer. * enable/disable displaying number of tabs in the right side (c) > let g:airline#extensions#tabline#show_tab_count = 1 + +Note: Not displayed if the number of tabs is less than 1 + +* always displaying number of tabs in the right side (c) > + let g:airline#extensions#tabline#show_tab_count = 2 < * configure filename match rules to exclude from the tabline. > let g:airline#extensions#tabline#excludes = []