From db6bf458fb815c0aa36add266113560312901386 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 17 Jan 2016 18:28:04 +0100 Subject: [PATCH] Check window size Before setting showtabline option, make sure, there is enough room fixes #863 --- autoload/airline/extensions/tabline/autoshow.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/airline/extensions/tabline/autoshow.vim b/autoload/airline/extensions/tabline/autoshow.vim index 8d39cc3..32bcf54 100644 --- a/autoload/airline/extensions/tabline/autoshow.vim +++ b/autoload/airline/extensions/tabline/autoshow.vim @@ -22,7 +22,9 @@ function! airline#extensions#tabline#autoshow#on() augroup airline_tabline_autoshow autocmd! if s:buf_min_count <= 0 && s:tab_min_count <= 1 - set showtabline=2 + if &lines > 3 + set showtabline=2 + endif else if s:show_buffers == 1 autocmd BufEnter * call show_tabline(s:buf_min_count, len(airline#extensions#tabline#buflist#list())) @@ -40,7 +42,7 @@ endfunction function! s:show_tabline(min_count, total_count) if a:total_count >= a:min_count - if &showtabline != 2 + if &showtabline != 2 && &lines > 3 set showtabline=2 endif else