diff --git a/autoload/airline/extensions/tabline/formatters/unique_tail.vim b/autoload/airline/extensions/tabline/formatters/unique_tail.vim index 22a720e..32a5867 100644 --- a/autoload/airline/extensions/tabline/formatters/unique_tail.vim +++ b/autoload/airline/extensions/tabline/formatters/unique_tail.vim @@ -23,5 +23,10 @@ function! airline#extensions#tabline#formatters#unique_tail#format(bufnr, buffer let map[nr] = airline#extensions#tabline#formatters#default#wrap_name(nr, fnamemodify(bufname(nr), ':p:.')) endfor - return map[a:bufnr] + if has_key(map, a:bufnr) + return map[a:bufnr] + endif + + " if we get here, the buffer list isn't in sync with the selected buffer yet, fall back to the default + return airline#extensions#tabline#formatters#default#format(a:bufnr, a:buffers) endfunction