From f5359f9177bafd1a2a68419e1e6a64fe49b91cd7 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Tue, 27 Sep 2016 21:44:00 +0200 Subject: [PATCH] do not skip empty sections for the tabline commit #3d667c32d3ac04 fixed a bug, that a section was not considered empty for the statusline, also g:airline_skip_empty was set. However unfortunately, this lead to a regression, makeing the tabline ugly, because sections, that contained a single highlighting group would be considered empty and would therefore be skipped. Since this is not what is expected, make s:section_is_empty() return zero, when it notices we are looking at a tabline. fixes #1273 --- autoload/airline/builder.vim | 4 +++- autoload/airline/extensions/tabline.vim | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/airline/builder.vim b/autoload/airline/builder.vim index 6c28f0b..85afde7 100644 --- a/autoload/airline/builder.vim +++ b/autoload/airline/builder.vim @@ -150,9 +150,11 @@ endfunction function! s:section_is_empty(self, content) let start=1 - " do not check for inactive windows + " do not check for inactive windows or the tabline if a:self._context.active == 0 return 0 + elseif get(a:self._context, 'tabline', 0) + return 0 endif " only check, if airline#skip_empty_sections == 1 diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index 058b9c3..cadb399 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -157,6 +157,7 @@ endfunction function! airline#extensions#tabline#new_builder() let builder_context = { \ 'active' : 1, + \ 'tabline' : 1, \ 'right_sep' : get(g:, 'airline#extensions#tabline#right_sep' , g:airline_right_sep), \ 'right_alt_sep' : get(g:, 'airline#extensions#tabline#right_alt_sep', g:airline_right_alt_sep), \ }