From 1d9ae3f972e76a1d36384da7a2890f6402d07d6c Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Wed, 18 Jan 2023 09:32:51 +0100 Subject: [PATCH] tabnr formmatter: return tabpagebuflist for tab_nr==0 --- .../airline/extensions/tabline/formatters/tabnr.vim | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/autoload/airline/extensions/tabline/formatters/tabnr.vim b/autoload/airline/extensions/tabline/formatters/tabnr.vim index 49670e10..516c3bd1 100644 --- a/autoload/airline/extensions/tabline/formatters/tabnr.vim +++ b/autoload/airline/extensions/tabline/formatters/tabnr.vim @@ -7,11 +7,9 @@ function! airline#extensions#tabline#formatters#tabnr#format(tab_nr, buflist) let spc=g:airline_symbols.space let tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0) if tab_nr_type == 0 " nr of splits - " TODO: What should be returned here: Just the buffer number? - " the following would return the buffer_number/list_of_splits - " return spc. a:tab_nr. '/'. len(a:buflist) - " for now, return the buffer number - return spc. a:tab_nr + " TODO: This doesn't seem to be the actual number of splits, + " but seems to behave like what users expect. + return spc. len(tabpagebuflist(a:buflist[0])) elseif tab_nr_type == 1 " tab number " Return only the current tab number return spc. a:tab_nr @@ -19,6 +17,4 @@ function! airline#extensions#tabline#formatters#tabnr#format(tab_nr, buflist) " return the tab number followed by the number of buffers (in the tab) return spc. a:tab_nr. spc. len(tabpagebuflist(a:buflist[0])) endif - -" return printf("%s %d/%d", spc, a:nr, len(tabpagebuflist(a:nr))) endfunction