Merge pull request #2363 from KSR-Yasuda/feature/ScratchBufName

Set bufname for [Scratch] (buftype = nofile)
This commit is contained in:
Christian Brabandt 2021-04-15 10:06:29 +02:00 committed by GitHub
commit 07ab201a27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,6 +34,9 @@ function! airline#extensions#fugitiveline#bufname()
let fmod = s:ModifierFlags()
if empty(b:fugitive_name)
if empty(bufname('%'))
return &buftype ==# 'nofile' ? '[Scratch]' : '[No Name]'
endif
return fnamemodify(bufname('%'), fmod)
else
return fnamemodify(b:fugitive_name, fmod). " [git]"