From 515d4cbbece50a1d70746587aeb9d44f4563e2ab Mon Sep 17 00:00:00 2001 From: eximus Date: Fri, 14 Apr 2023 14:18:03 -0400 Subject: [PATCH] fix tabline tabnr formatter - nr of splits --- autoload/airline/extensions/tabline/formatters/tabnr.vim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/autoload/airline/extensions/tabline/formatters/tabnr.vim b/autoload/airline/extensions/tabline/formatters/tabnr.vim index 516c3bd1..1687fbe4 100644 --- a/autoload/airline/extensions/tabline/formatters/tabnr.vim +++ b/autoload/airline/extensions/tabline/formatters/tabnr.vim @@ -7,14 +7,12 @@ 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: 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])) + return spc. len(tabpagebuflist(a:tab_nr)) elseif tab_nr_type == 1 " tab number " Return only the current tab number return spc. a:tab_nr else " tab_nr_type == 2 splits and tab number " return the tab number followed by the number of buffers (in the tab) - return spc. a:tab_nr. spc. len(tabpagebuflist(a:buflist[0])) + return spc. a:tab_nr. spc. len(tabpagebuflist(a:tab_nr)) endif endfunction