tabline: add consistent tab label to the end

closes #1882
closes #1883
This commit is contained in:
Christian Brabandt 2019-03-08 14:05:38 +01:00
parent 1c3ae6077a
commit 6ab14bf474
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
3 changed files with 8 additions and 3 deletions

View File

@ -229,3 +229,9 @@ function! airline#extensions#tabline#add_label(dict, type)
\ get(g:, 'airline#extensions#tabline#'.a:type.'_label', a:type)) \ get(g:, 'airline#extensions#tabline#'.a:type.'_label', a:type))
endif endif
endfunction endfunction
function! airline#extensions#tabline#add_tab_label(dict)
if tabpagenr('$') > 1
call a:dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
endif
endfunction

View File

@ -140,9 +140,7 @@ function! airline#extensions#tabline#buffers#get()
call airline#extensions#tabline#add_label(b, 'buffers') call airline#extensions#tabline#add_label(b, 'buffers')
endif endif
if tabpagenr('$') > 1 call airline#extensions#tabline#add_tab_label(b)
call b.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$')))
endif
let s:current_bufnr = cur let s:current_bufnr = cur
let s:column_width = &columns let s:column_width = &columns

View File

@ -92,6 +92,7 @@ function! airline#extensions#tabline#tabs#get()
call airline#extensions#tabline#add_label(b, 'buffers') call airline#extensions#tabline#add_label(b, 'buffers')
endif endif
endif endif
call airline#extensions#tabline#add_tab_label(b)
let s:current_bufnr = curbuf let s:current_bufnr = curbuf
let s:current_tabnr = curtab let s:current_tabnr = curtab