From bc5945de6581957091ff5253256ec4c4bfb4c619 Mon Sep 17 00:00:00 2001 From: yasuda Date: Wed, 14 Apr 2021 15:30:03 +0900 Subject: [PATCH] Set bufname for [Scratch] (buftype = nofile) or [No Name] (otherwise) --- autoload/airline/extensions/fugitiveline.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autoload/airline/extensions/fugitiveline.vim b/autoload/airline/extensions/fugitiveline.vim index d9415e22..8cfd1391 100644 --- a/autoload/airline/extensions/fugitiveline.vim +++ b/autoload/airline/extensions/fugitiveline.vim @@ -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]"