From 4d706c5f4ad4a0ffa7c89af3b45e296d906d0fd6 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Wed, 25 Sep 2013 19:26:25 +0000 Subject: [PATCH] use columns instead of winwidth (#222). --- autoload/airline/extensions/tabline.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index 2c3e5fac..6b85b4b9 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -124,12 +124,13 @@ function! s:get_visible_buffers() " only show current and surrounding buffers if there are too many buffers let position = index(buffers, cur) - if total_width > winwidth(0) && position > -1 + let vimwidth = &columns + if total_width > vimwidth && position > -1 let buf_count = len(buffers) " determine how many buffers to show based on the longest buffer width, " use one on the right side and put the rest on the left - let buf_max = winwidth(0) / max_width + let buf_max = vimwidth / max_width let buf_right = 1 let buf_left = max([0, buf_max - buf_right])