tabline: refactor label function

This commit is contained in:
Christian Brabandt
2018-01-04 18:43:03 +01:00
parent 3985ece131
commit 3b631ef0c4
3 changed files with 10 additions and 12 deletions
+7
View File
@@ -201,3 +201,10 @@ function! airline#extensions#tabline#group_of_bufnr(tab_bufs, bufnr)
endif
return group
endfunction
function! airline#extensions#tabline#add_label(dict, type)
if get(g:, 'airline#extensions#tabline#show_tab_type', 1)
call a:dict.add_section_spaced('airline_tab',
\ get(g:, 'airline#extensions#tabline#'.a:type.'_label', '['.a:type.']'))
endif
endfunction