mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-21 21:14:47 +02:00
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
|
scriptencoding utf-8
|
||||||
|
|
||||||
function! airline#extensions#tabline#formatters#tabnr#format(tab_nr_type, nr)
|
function! airline#extensions#tabline#formatters#tabnr#format(nr, buflist)
|
||||||
" TODO: Is this actually useful? Or should we remove this one?
|
|
||||||
let nr = type(a:nr) == type([]) ? a:nr[0] : a:nr
|
|
||||||
let spc=g:airline_symbols.space
|
let spc=g:airline_symbols.space
|
||||||
if a:tab_nr_type == 0 " nr of splits
|
|
||||||
return spc. '%{len(tabpagebuflist('.nr.'))}'
|
return printf("%s %d/%d", spc, a:nr, len(tabpagebuflist(a: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
|
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user