From 1e7648cfdd43c6f600f16825ef08af8e35d2ee4a Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 10 Feb 2010 10:07:56 -0500 Subject: [PATCH] Autodetect need for uppercase statusline flag --- plugin/fugitive.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index d400ec4..4d8d0e8 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1632,7 +1632,7 @@ function! fugitive#statusline(...) if !exists('b:git_dir') return '' endif - let status = 'Git' + let status = '' if s:buffer().commit() != '' let status .= ':' . s:buffer().commit()[0:7] endif @@ -1642,7 +1642,11 @@ function! fugitive#statusline(...) elseif head =~# '^\x\{40\}$' let status .= '('.head[0:7].')' endif - return '['.status.']' + if &statusline =~# '%[MRHWY]' && &statusline !~# '%[mrhwy]' + return ',GIT'.status + else + return '[Git'.status.']' + endif endfunction " }}}1