From aee733aa877911c9ae192fd1d6b9f8a0a169883c Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Sun, 1 Apr 2018 00:16:29 +0100 Subject: [PATCH] Don't show titles in the tabline if there aren't any airline#extensions#tabline#buflist#list doesn't pick up some buffers (most notably Netrw buffers), so there are sometimes no buffers to show and the tabline code fails with an error. This avoids that situation. It would be better to detect these and show titles for them, but for now this restores the old behaviour. --- autoload/airline/extensions/tabline/builder.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/airline/extensions/tabline/builder.vim b/autoload/airline/extensions/tabline/builder.vim index 7e7d49f7..20964b15 100644 --- a/autoload/airline/extensions/tabline/builder.vim +++ b/autoload/airline/extensions/tabline/builder.vim @@ -94,7 +94,7 @@ endfunction " Callers should define at least |get_title| and |get_group| on the host " object if |insert_titles| has been called on it. function! s:prototype.build() dict - if has_key(self, '_left_position') + if has_key(self, '_left_position') && self._first_title <= self._last_title let self._remaining_space = &columns - s:tabline_evaluated_length(self._build()) let center_active = get(g:, 'airline#extensions#tabline#center_active', 0)