Autodetect need for uppercase statusline flag

This commit is contained in:
Tim Pope 2010-02-10 10:07:56 -05:00
parent bd0fddbd8b
commit 1e7648cfdd

View File

@ -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