Experimental support for blank buffers

This commit is contained in:
Tim Pope
2019-09-01 20:47:49 -05:00
parent d2837b103c
commit 1937bc3cd9

View File

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