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:
parent
4f5b641710
commit
1028c6ea12
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue