mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-23 14:04:53 +02:00
tabline: Vim9 script implementation of add_tab_label
This commit is contained in:
parent
6ff95bac4e
commit
cc2a836b9a
@ -457,4 +457,12 @@ else
|
|||||||
get(g:, 'airline#extensions#tabline#' .. type .. '_label', type))
|
get(g:, 'airline#extensions#tabline#' .. type .. '_label', type))
|
||||||
endif
|
endif
|
||||||
enddef
|
enddef
|
||||||
|
def airline#extensions#tabline#add_tab_label(dict: dict<any>): void # {{{2
|
||||||
|
var show_tab_count = get(g:, 'airline#extensions#tabline#show_tab_count', 1)
|
||||||
|
if show_tab_count == 2
|
||||||
|
dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
|
||||||
|
elseif show_tab_count == 1 && tabpagenr('$') > 1
|
||||||
|
dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
|
||||||
|
endif
|
||||||
|
enddef
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user