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

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]"