From f11e133c1a62fc3541bd00035bec4ce361b8252e Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sat, 7 Sep 2013 01:33:07 +0000 Subject: [PATCH] take window size into account before restricting the limit. --- autoload/airline/extensions/tabline.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index 7969f6f..a015147 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -21,7 +21,7 @@ let s:buf_min_count = get(g:, 'airline#extensions#tabline#buffer_min_count', 0) let s:buf_len = 0 " TODO: temporary -let s:buf_max = get(g:, 'airline#extensions#tabline#buffer_max', 6) +let s:buf_max = get(g:, 'airline#extensions#tabline#buffer_max', winwidth(0) / 16) function! airline#extensions#tabline#init(ext) if has('gui_running') @@ -119,7 +119,7 @@ function! s:get_buffer_list() " 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 + while buffers[1] != cur let first = remove(buffers, 0) call add(buffers, first) endwhile