From 1028c6ea12dc70bd3be9abb2bd7abf7d1b6ed17d Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Wed, 11 Jan 2023 16:41:08 +0100 Subject: [PATCH] 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 --- .../airline/extensions/tabline/formatters/tabnr.vim | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/autoload/airline/extensions/tabline/formatters/tabnr.vim b/autoload/airline/extensions/tabline/formatters/tabnr.vim index 8cd500d8..0499b99c 100644 --- a/autoload/airline/extensions/tabline/formatters/tabnr.vim +++ b/autoload/airline/extensions/tabline/formatters/tabnr.vim @@ -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