Support blank buffers

Closes https://github.com/tpope/vim-fugitive/issues/1000
This commit is contained in:
Tim Pope
2019-09-05 15:46:27 -04:00
parent ff0eeac045
commit ec918b9a79

View File

@@ -11,8 +11,7 @@ let g:loaded_fugitive = 1
function! FugitiveGitDir(...) abort function! FugitiveGitDir(...) abort
if !a:0 || type(a:1) == type(0) && a:1 < 0 if !a:0 || type(a:1) == type(0) && a:1 < 0
let dir = get(b:, 'git_dir', '') let dir = get(b:, 'git_dir', '')
if empty(dir) && get(g:, 'fugitive_blank_buffer_2019_alpha') && strftime('%Y') == 2019 && if empty(dir) && (empty(bufname('')) || &buftype =~# '^\%(nofile\|acwrite\|quickfix\|prompt\)$')
\ (empty(bufname('')) || &buftype =~# '^\%(nofile\|acwrite\|quickfix\|prompt\)$')
return FugitiveExtractGitDir(getcwd()) return FugitiveExtractGitDir(getcwd())
endif endif
return dir return dir