commit 0ec3bb2bdd36af5d4721109d35d5df10955bd495 (tree)
parent d11c90ad6624bb4502cabcc0eb2034e17ddda083
Author: Tim Pope <code@tpope.net>
Date: Mon, 5 Jul 2021 16:41:39 -0400
Use cwd to find Git repository for terminal window
Closes https://github.com/tpope/vim-fugitive/issues/1520
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim
@@ -18,7 +18,7 @@ function! FugitiveGitDir(...) abort
return g:fugitive_event
endif
let dir = get(b:, 'git_dir', '')
- if empty(dir) && (empty(bufname('')) || &buftype =~# '^\%(nofile\|acwrite\|quickfix\|prompt\)$')
+ if empty(dir) && (empty(bufname('')) || &buftype =~# '^\%(nofile\|acwrite\|quickfix\|terminal\|prompt\)$')
return FugitiveExtractGitDir(getcwd())
elseif (!exists('b:git_dir') || b:git_dir =~# s:bad_git_dir) && empty(&buftype)
let b:git_dir = FugitiveExtractGitDir(expand('%:p'))