mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-22 09:58:29 +08:00
tabline: allow to show buffers label at start
This commit is contained in:
parent
9d28f0dcc7
commit
c518f79aab
|
@ -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('$')))
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user