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.
This commit is contained in:
mrmr1993 2018-04-01 00:16:29 +01:00
parent c75106f12d
commit aee733aa87
1 changed files with 1 additions and 1 deletions

View File

@ -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)