tabnr formmatter: return tabpagebuflist for tab_nr==0

This commit is contained in:
Christian Brabandt 2023-01-18 09:32:51 +01:00
parent f46792ebcb
commit 1d9ae3f972
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -7,11 +7,9 @@ function! airline#extensions#tabline#formatters#tabnr#format(tab_nr, buflist)
let spc=g:airline_symbols.space let spc=g:airline_symbols.space
let tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0) let tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0)
if tab_nr_type == 0 " nr of splits if tab_nr_type == 0 " nr of splits
" TODO: What should be returned here: Just the buffer number? " TODO: This doesn't seem to be the actual number of splits,
" the following would return the buffer_number/list_of_splits " but seems to behave like what users expect.
" return spc. a:tab_nr. '/'. len(a:buflist) return spc. len(tabpagebuflist(a:buflist[0]))
" for now, return the buffer number
return spc. a:tab_nr
elseif tab_nr_type == 1 " tab number elseif tab_nr_type == 1 " tab number
" Return only the current tab number " Return only the current tab number
return spc. a:tab_nr 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 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:buflist[0]))
endif endif
" return printf("%s %d/%d", spc, a:nr, len(tabpagebuflist(a:nr)))
endfunction endfunction