mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Experimental support for blank buffers
This commit is contained in:
@@ -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('')
|
||||
|
||||
Reference in New Issue
Block a user