mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-23 22:15:28 +02:00
Merge pull request #2635 from 3ximus/master
Fix the number of splits in a tab displayed in the tabline
This commit is contained in:
commit
5891a3f7be
@ -7,14 +7,12 @@ 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: This doesn't seem to be the actual number of splits,
|
return spc. len(tabpagebuflist(a:tab_nr))
|
||||||
" but seems to behave like what users expect.
|
|
||||||
return spc. len(tabpagebuflist(a:buflist[0]))
|
|
||||||
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
|
||||||
else " tab_nr_type == 2 splits and tab number
|
else " tab_nr_type == 2 splits and tab number
|
||||||
" 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:tab_nr))
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user