vim-airline/autoload/airline/extensions/tabline/formatters/tabnr.vim

16 lines
491 B
VimL
Raw Normal View History

2019-03-25 07:27:10 -04:00
" MIT License. Copyright (c) 2017-2019 Christian Brabandt et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
function! airline#extensions#tabline#formatters#tabnr#format(tab_nr_type, nr)
2019-02-02 11:45:33 -05:00
let spc=g:airline_symbols.space
if a:tab_nr_type == 0 " nr of splits
2019-02-02 11:45:33 -05:00
return spc. '%{len(tabpagebuflist('.a:nr.'))}'
elseif a:tab_nr_type == 1 " tab number
2019-02-02 11:45:33 -05:00
return spc. a:nr
else "== 2 splits and tab number
2019-02-02 11:45:33 -05:00
return spc. a:nr. '.%{len(tabpagebuflist('.a:nr.'))}'
endif
endfunction