tabnr: replace by a new naive function

This function simply returns the current tabnumber followed by the
number of buffers in the current tabpage.

The previous one either was broken long ago or did not work as expected.

fixes #2616
This commit is contained in:
Christian Brabandt 2023-01-11 16:41:08 +01:00
parent 4f5b641710
commit 1028c6ea12
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 3 additions and 10 deletions

View File

@ -3,15 +3,8 @@
scriptencoding utf-8
function! airline#extensions#tabline#formatters#tabnr#format(tab_nr_type, nr)
" TODO: Is this actually useful? Or should we remove this one?
let nr = type(a:nr) == type([]) ? a:nr[0] : a:nr
function! airline#extensions#tabline#formatters#tabnr#format(nr, buflist)
let spc=g:airline_symbols.space
if a:tab_nr_type == 0 " nr of splits
return spc. '%{len(tabpagebuflist('.nr.'))}'
elseif a:tab_nr_type == 1 " tab number
return spc. nr
else "== 2 splits and tab number
return spc. nr. '.%{len(tabpagebuflist('.nr.'))}'
endif
return printf("%s %d/%d", spc, a:nr, len(tabpagebuflist(a:nr)))
endfunction