tabnr.vim 691 B

123456789101112131415161718
  1. " MIT License. Copyright (c) 2017-2021 Christian Brabandt et al.
  2. " vim: et ts=2 sts=2 sw=2
  3. scriptencoding utf-8
  4. function! airline#extensions#tabline#formatters#tabnr#format(tab_nr, buflist)
  5. let spc=g:airline_symbols.space
  6. let tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0)
  7. if tab_nr_type == 0 " nr of splits
  8. return spc. len(tabpagebuflist(a:tab_nr))
  9. elseif tab_nr_type == 1 " tab number
  10. " Return only the current tab number
  11. return spc. a:tab_nr
  12. else " tab_nr_type == 2 splits and tab number
  13. " return the tab number followed by the number of buffers (in the tab)
  14. return spc. a:tab_nr. spc. len(tabpagebuflist(a:tab_nr))
  15. endif
  16. endfunction