[add] new option / always show tab count feature

This commit is contained in:
kazukazuinaina 2020-03-30 01:06:06 +09:00
parent c05fff8504
commit 185bcc5e88
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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 = []