mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-06 13:44:42 +02:00
formatter: tabnr expects a number bot got List
Make sure, that the second argument is actually a number and not a list. Note: even when fixing this, the tabpage still shows some strange output e.g. currently 1 1.%{len(tabpagebuflist(1))} In a vim window. Not sure, why Vim does no longer evaluate those %{..} sections. Perhaps some change in Vim? closes #2616
This commit is contained in:
parent
9007d19ab7
commit
4f5b641710
@ -4,12 +4,14 @@
|
|||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
|
|
||||||
function! airline#extensions#tabline#formatters#tabnr#format(tab_nr_type, nr)
|
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
|
||||||
let spc=g:airline_symbols.space
|
let spc=g:airline_symbols.space
|
||||||
if a:tab_nr_type == 0 " nr of splits
|
if a:tab_nr_type == 0 " nr of splits
|
||||||
return spc. '%{len(tabpagebuflist('.a:nr.'))}'
|
return spc. '%{len(tabpagebuflist('.nr.'))}'
|
||||||
elseif a:tab_nr_type == 1 " tab number
|
elseif a:tab_nr_type == 1 " tab number
|
||||||
return spc. a:nr
|
return spc. nr
|
||||||
else "== 2 splits and tab number
|
else "== 2 splits and tab number
|
||||||
return spc. a:nr. '.%{len(tabpagebuflist('.a:nr.'))}'
|
return spc. nr. '.%{len(tabpagebuflist('.nr.'))}'
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user