mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-25 17:57:36 +08:00
Merge pull request #2363 from KSR-Yasuda/feature/ScratchBufName
Set bufname for [Scratch] (buftype = nofile)
This commit is contained in:
commit
07ab201a27
|
@ -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]"
|
||||
|
|
Loading…
Reference in New Issue
Block a user