From f5fc469c0c511a5196b6c2ba565b2b6bf6a9d1aa Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 6 Sep 2019 17:16:19 -0400 Subject: [PATCH] Ignore blank buffers in fugitive#Statusline() --- autoload/fugitive.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index af57942..93bc7ca 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -5756,7 +5756,8 @@ endfunction " Section: Statusline function! fugitive#Statusline(...) abort - if empty(s:Dir()) + let dir = s:Dir(bufnr('')) + if empty(dir) return '' endif let status = '' @@ -5764,7 +5765,7 @@ function! fugitive#Statusline(...) abort if len(commit) let status .= ':' . commit[0:6] endif - let status .= '('.FugitiveHead(7).')' + let status .= '('.FugitiveHead(7, dir).')' return '[Git'.status.']' endfunction -- 2.11.4.GIT