fix buffer mismatch in certain cases. resolves #715.

This commit is contained in:
Bailey Ling 2015-02-26 23:08:59 -05:00
parent b08784907a
commit c78767a564
1 changed files with 6 additions and 1 deletions

View File

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