tabline: allow to show buffers label at start

This commit is contained in:
Christian Brabandt 2018-01-04 19:37:45 +01:00
parent 9d28f0dcc7
commit c518f79aab
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 14 additions and 1 deletions

View File

@ -61,6 +61,14 @@ function! airline#extensions#tabline#buffers#get()
let index = 1
let b = airline#extensions#tabline#new_builder()
let tab_bufs = tabpagebuflist(tabpagenr())
let show_buf_label_first = 0
if get(g:, 'airline#extensions#tabline#buf_label_first', 0)
let show_buf_label_first = 1
endif
if show_buf_label_first
call airline#extensions#tabline#add_label(b, 'buffers')
endif
for nr in s:get_visible_buffers()
if nr < 0
call b.add_raw('%#airline_tabhid#...')
@ -97,7 +105,9 @@ function! airline#extensions#tabline#buffers#get()
call b.add_section('airline_tabfill', '')
call b.split()
call b.add_section('airline_tabfill', '')
call airline#extensions#tabline#add_label(b, 'buffers')
if !show_buf_label_first
call airline#extensions#tabline#add_label(b, 'buffers')
endif
if tabpagenr('$') > 1
call b.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))

View File

@ -692,6 +692,9 @@ with the middle mouse button to delete that buffer.
* enable/disable displaying tab type (e.g. [buffers]/[tabs]) >
let g:airline#extensions#tabline#show_tab_type = 1
* show buffer label at first position: >
let g:airline#extensions#tabline#buf_label_first = 1
* rename label for buffers (default: 'buffers') (c) >
let g:airline#extensions#tabline#buffers_label = 'b'