Merge remote-tracking branch 'upstream/master'

Merging bling's upstream into my fork
This commit is contained in:
Pychimp 2013-09-05 23:03:45 +05:30
commit 003522a42d

View File

@ -20,6 +20,9 @@ let s:builder_context = {
let s:buf_min_count = get(g:, 'airline#extensions#tabline#buffer_min_count', 0) let s:buf_min_count = get(g:, 'airline#extensions#tabline#buffer_min_count', 0)
let s:buf_len = 0 let s:buf_len = 0
" TODO: temporary
let s:buf_max = get(g:, 'airline#extensions#tabline#buffer_max', 6)
function! airline#extensions#tabline#init(ext) function! airline#extensions#tabline#init(ext)
if has('gui_running') if has('gui_running')
set guioptions-=e set guioptions-=e
@ -111,6 +114,16 @@ function! s:get_buffer_list()
call add(buffers, nr) call add(buffers, nr)
endif endif
endfor endfor
" TODO: temporary fix; force the active buffer to be first when there are many buffers open
if len(buffers) > s:buf_max && index(buffers, cur) > -1
while buffers[0] != cur
let first = remove(buffers, 0)
call add(buffers, first)
endwhile
let buffers = buffers[:s:buf_max]
endif
return buffers return buffers
endfunction endfunction