mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-27 16:04:39 +02:00
tabline: disable Vim9 script add_tab_label
This commit is contained in:
parent
4bce179ed3
commit
f54f7859a3
@ -31,6 +31,15 @@ function! airline#extensions#tabline#add_label(dict, type, right)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! airline#extensions#tabline#add_tab_label(dict)
|
||||||
|
let show_tab_count = get(g:, 'airline#extensions#tabline#show_tab_count', 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
|
||||||
|
|
||||||
if !exists(":def") || (exists(":def") && get(g:, "airline_experimental", 0)==0)
|
if !exists(":def") || (exists(":def") && get(g:, "airline_experimental", 0)==0)
|
||||||
|
|
||||||
" Legacy VimScript implementation " {{{1
|
" Legacy VimScript implementation " {{{1
|
||||||
@ -467,12 +476,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
|
" 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)
|
" var show_tab_count = get(g:, 'airline#extensions#tabline#show_tab_count', 1)
|
||||||
if show_tab_count == 2
|
" if show_tab_count == 2
|
||||||
dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
|
" dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
|
||||||
elseif show_tab_count == 1 && tabpagenr('$') > 1
|
" elseif show_tab_count == 1 && tabpagenr('$') > 1
|
||||||
dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
|
" dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
|
||||||
endif
|
" endif
|
||||||
enddef
|
" enddef
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user