Merge pull request #1702 from mrmr1993/fix-buffer-counts

Fix buffer numbering to start from 1 with buffer_idx_mode
This commit is contained in:
Christian Brabandt 2018-04-03 03:16:38 +02:00 committed by GitHub
commit 47bdae9067
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,6 @@ function! airline#extensions#tabline#buffers#get()
endif
endif
let index = 1
let b = airline#extensions#tabline#new_builder()
let tab_bufs = tabpagebuflist(tabpagenr())
let show_buf_label_first = 0
@ -116,9 +115,9 @@ function! airline#extensions#tabline#buffers#get()
if get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0)
if len(s:number_map) > 0
return space. get(s:number_map, a:i, '') . '%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)' . s:spc
return space. get(s:number_map, a:i+1, '') . '%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)' . s:spc
else
return '['.a:i.s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)'.']'
return '['.(a:i+1).s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)'.']'
endif
else
return space.'%(%{airline#extensions#tabline#get_buffer_name('.bufnum.')}%)'.s:spc