mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-01-19 10:42:46 +08:00
Set bufname for [Scratch] (buftype = nofile) or [No Name] (otherwise)
This commit is contained in:
parent
ed60e1d369
commit
bc5945de65
|
@ -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