Don't let the current buffer be -1 when calculating the tabline

This commit is contained in:
mrmr1993 2018-04-01 01:16:20 +01:00
parent aee733aa87
commit 47c36d2819
1 changed files with 2 additions and 1 deletions

View File

@ -125,8 +125,9 @@ function! airline#extensions#tabline#buffers#get()
endif
endfunction
let current_buffer = max([index(b.buffers, cur), 0])
let last_buffer = len(b.buffers) - 1
call b.insert_titles(index(b.buffers, cur), 0, last_buffer)
call b.insert_titles(current_buffer, 0, last_buffer)
call b.add_section('airline_tabfill', '')
call b.split()