mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-09 20:13:46 -05:00
Experimental support for blank buffers
This commit is contained in:
@@ -9,8 +9,13 @@ endif
|
|||||||
let g:loaded_fugitive = 1
|
let g:loaded_fugitive = 1
|
||||||
|
|
||||||
function! FugitiveGitDir(...) abort
|
function! FugitiveGitDir(...) abort
|
||||||
if !a:0 || a:1 ==# -1
|
if !a:0 || type(a:1) == type(0) && a:1 < 0
|
||||||
return get(b:, 'git_dir', '')
|
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)
|
elseif type(a:1) == type(0)
|
||||||
return getbufvar(a:1, 'git_dir')
|
return getbufvar(a:1, 'git_dir')
|
||||||
elseif type(a:1) == type('')
|
elseif type(a:1) == type('')
|
||||||
|
|||||||
Reference in New Issue
Block a user