From 62f3d1d412406b4584506ba5ece3f0abf85dab0d Mon Sep 17 00:00:00 2001 From: Aaron Miller Date: Mon, 29 Oct 2018 03:26:59 -0400 Subject: [PATCH] Add option for numbered tabs Cleaned up variable name, added documentation --- autoload/airline/extensions/tabline/ctrlspace.vim | 6 +++++- doc/airline.txt | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/tabline/ctrlspace.vim b/autoload/airline/extensions/tabline/ctrlspace.vim index a1f2fec..bb2d518 100644 --- a/autoload/airline/extensions/tabline/ctrlspace.vim +++ b/autoload/airline/extensions/tabline/ctrlspace.vim @@ -71,7 +71,11 @@ function! airline#extensions#tabline#ctrlspace#add_tab_section(builder, pull_rig \ .s:highlight_groups[(4 * tab.modified) + (3 * tab.current)] \ .pos_extension - call a:builder.add_section_spaced(group, '%'.tab.index.'T'.tab.title.ctrlspace#api#TabBuffersNumber(tab.index).'%T') + if get(g:, 'airline#extensions#tabline#ctrlspace_show_tab_nr', 0) == 0 + call a:builder.add_section_spaced(group, '%'.tab.index.'T'.tab.title.ctrlspace#api#TabBuffersNumber(tab.index).'%T') + else + call a:builder.add_section_spaced(group, '%'.(tab.index).'T'.(tab.index).(g:airline_symbols.space).(tab.title).ctrlspace#api#TabBuffersNumber(tab.index).'%T') + endif endfor endfunction diff --git a/doc/airline.txt b/doc/airline.txt index 52f1a58..8562e2e 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -752,6 +752,9 @@ with the middle mouse button to delete that buffer. * enable/disable displaying tab number in tabs mode. > let g:airline#extensions#tabline#show_tab_nr = 1 +* enable/disable displaying tab number in tabs mode for ctrlspace. (c) > + let g:airline#extensions#tabline#ctrlspace_show_tab_nr = 0 + * enable/disable displaying tab type (e.g. [buffers]/[tabs]) > let g:airline#extensions#tabline#show_tab_type = 1