mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-09 03:53:47 -05:00
Use the neovim terminal emulator for :Git
This commit is contained in:
committed by
Tim Pope
parent
baa05dcfda
commit
4cc201cbe3
@@ -670,8 +670,17 @@ function! s:Git(bang, args) abort
|
|||||||
let git .= ' --no-pager'
|
let git .= ' --no-pager'
|
||||||
endif
|
endif
|
||||||
let args = matchstr(a:args,'\v\C.{-}%($|\\@<!%(\\\\)*\|)@=')
|
let args = matchstr(a:args,'\v\C.{-}%($|\\@<!%(\\\\)*\|)@=')
|
||||||
call s:ExecuteInTree('!'.git.' '.args)
|
if exists(':terminal')
|
||||||
call fugitive#reload_status()
|
let dir = s:repo().tree()
|
||||||
|
tabnew
|
||||||
|
execute 'lcd' fnameescape(dir)
|
||||||
|
execute 'terminal' git args
|
||||||
|
else
|
||||||
|
call s:ExecuteInTree('!'.git.' '.args)
|
||||||
|
if has('win32')
|
||||||
|
call fugitive#reload_status()
|
||||||
|
endif
|
||||||
|
endif
|
||||||
return matchstr(a:args, '\v\C\\@<!%(\\\\)*\|\zs.*')
|
return matchstr(a:args, '\v\C\\@<!%(\\\\)*\|\zs.*')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -708,6 +717,7 @@ augroup fugitive_status
|
|||||||
autocmd!
|
autocmd!
|
||||||
if !has('win32')
|
if !has('win32')
|
||||||
autocmd FocusGained,ShellCmdPost * call fugitive#reload_status()
|
autocmd FocusGained,ShellCmdPost * call fugitive#reload_status()
|
||||||
|
autocmd BufDelete term://* call fugitive#reload_status()
|
||||||
endif
|
endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user