diff --git a/autoload/airline/extensions/tabline/tabs.vim b/autoload/airline/extensions/tabline/tabs.vim index 3af5476c..afe30766 100644 --- a/autoload/airline/extensions/tabline/tabs.vim +++ b/autoload/airline/extensions/tabline/tabs.vim @@ -2,9 +2,11 @@ " vim: et ts=2 sts=2 sw=2 let s:show_close_button = get(g:, 'airline#extensions#tabline#show_close_button', 1) +let s:show_tab_type = get(g:, 'airline#extensions#tabline#show_tab_type', 1) let s:show_tab_nr = get(g:, 'airline#extensions#tabline#show_tab_nr', 1) let s:tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0) let s:close_symbol = get(g:, 'airline#extensions#tabline#close_symbol', 'X') +let s:show_splits = get(g:, 'airline#extensions#tabline#show_splits', 1) let s:spc = g:airline_symbols.space let s:current_bufnr = -1 @@ -40,17 +42,6 @@ function! airline#extensions#tabline#tabs#get() let b = airline#extensions#tabline#new_builder() - let buffers = tabpagebuflist(curtab) - for nr in buffers - let group = airline#extensions#tabline#group_of_bufnr(buffers, nr) - call b.add_section_spaced(group, '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)') - endfor - " truncate - call b.add_raw('%<') - call b.add_section('airline_tabfill', '') - call b.split() - call b.add_section('airline_tabfill', '') - for i in range(1, tabpagenr('$')) if i == curtab let group = 'airline_tabsel_right' @@ -77,11 +68,24 @@ function! airline#extensions#tabline#tabs#get() endif call b.add_section(group, val.'%'.i.'T %{airline#extensions#tabline#title('.i.')} %)') endfor - call b.add_raw('%<') - if s:show_close_button - call b.add_section('airline_tab_right', ' %999X'.s:close_symbol.' ') - endif + call b.add_section('airline_tabfill', '') + call b.split() + call b.add_section('airline_tabfill', '') + + if s:show_close_button + call b.add_section('airline_tab_right', ' %999X'.s:close_symbol.' ') + endif + + if s:show_splits == 1 + let buffers = tabpagebuflist(curtab) + for nr in buffers + let group = airline#extensions#tabline#group_of_bufnr(buffers, nr) + call b.add_section_spaced(group, '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)') + endfor + elseif s:show_tab_type == 1 + call b.add_section('airline_tabtype', ' tabs ') + endif let s:current_bufnr = curbuf let s:current_tabnr = curtab