From 10c54dfc931e37eecdce621d700bfa29fe1a4123 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 4 Sep 2019 15:22:22 -0400 Subject: [PATCH] Set b:git_dir for :terminal buffers --- autoload/fugitive.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 40166ac..05f6ebd 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2114,12 +2114,13 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort \ s:HasOpt(args, ['add', 'clean', 'stage'], '-i', '--interactive') || \ index(['--paginate', '-p'], args[0]) >= 0 let mods = substitute(s:Mods(a:mods), '\', '-tab', 'g') + let assign = len(dir) ? '|let b:git_dir = ' . string(dir) : '' if has('nvim') if &autowrite || &autowriteall | silent! wall | endif - return mods . (a:line2 ? 'split' : 'edit') . ' term://' . s:fnameescape(s:UserCommand(dir, args)) . '|startinsert' . after + return mods . (a:line2 ? 'split' : 'edit') . ' term://' . s:fnameescape(s:UserCommand(dir, args)) . assign . '|startinsert' . after elseif has('terminal') if &autowrite || &autowriteall | silent! wall | endif - return 'exe ' . string(mods . 'terminal ' . (a:line2 ? '' : '++curwin ') . join(map(s:UserCommandList(dir) + args, 's:fnameescape(v:val)'))) . after + return 'exe ' . string(mods . 'terminal ' . (a:line2 ? '' : '++curwin ') . join(map(s:UserCommandList(dir) + args, 's:fnameescape(v:val)'))) . assign . after endif endif if has('gui_running') && !has('win32')