mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-16 23:33:43 -05:00
Remove :terminal special case for Neovim :Git
Neovim appears to be better about not locking up on terminal input, and GIT_TERMINAL_PROMPT=0 gives us belt-and-suspenders protection.
This commit is contained in:
@@ -1872,29 +1872,21 @@ function! s:GitCommand(line1, line2, range, count, bang, mods, reg, arg, args) a
|
|||||||
if has('gui_running') && !has('win32')
|
if has('gui_running') && !has('win32')
|
||||||
let git .= ' --no-pager'
|
let git .= ' --no-pager'
|
||||||
endif
|
endif
|
||||||
|
if has('nvim') && executable('env')
|
||||||
|
let git = 'env GIT_TERMINAL_PROMPT=0 ' . git
|
||||||
|
endif
|
||||||
let args = matchstr(a:arg,'\v\C.{-}%($|\\@<!%(\\\\)*\|)@=')
|
let args = matchstr(a:arg,'\v\C.{-}%($|\\@<!%(\\\\)*\|)@=')
|
||||||
let after = matchstr(a:arg, '\v\C\\@<!%(\\\\)*\zs\|.*')
|
let after = matchstr(a:arg, '\v\C\\@<!%(\\\\)*\zs\|.*')
|
||||||
let tree = s:Tree()
|
let tree = s:Tree()
|
||||||
if !s:CanAutoReloadStatus()
|
if !s:CanAutoReloadStatus()
|
||||||
let after = '|call fugitive#ReloadStatus()' . after
|
let after = '|call fugitive#ReloadStatus()' . after
|
||||||
endif
|
endif
|
||||||
if exists(':terminal') && has('nvim') && !get(g:, 'fugitive_force_bang_command')
|
let cmd = "exe '!'.escape(" . string(git) . " . ' ' . s:ShellExpand(" . string(args) . "),'!#%')"
|
||||||
if len(@%)
|
if s:cpath(tree) !=# s:cpath(getcwd())
|
||||||
-tabedit %
|
let cd = s:Cd()
|
||||||
else
|
let cmd = 'try|' . cd . ' ' . tree . '|' . cmd . '|finally|' . cd . ' ' . s:fnameescape(getcwd()) . '|endtry'
|
||||||
-tabnew
|
|
||||||
endif
|
|
||||||
execute 'lcd' fnameescape(tree)
|
|
||||||
let exec = escape(git . ' ' . s:ShellExpand(args), '#%')
|
|
||||||
return 'exe ' . string('terminal ' . exec) . after
|
|
||||||
else
|
|
||||||
let cmd = "exe '!'.escape(" . string(git) . " . ' ' . s:ShellExpand(" . string(args) . "),'!#%')"
|
|
||||||
if s:cpath(tree) !=# s:cpath(getcwd())
|
|
||||||
let cd = s:Cd()
|
|
||||||
let cmd = 'try|' . cd . ' ' . tree . '|' . cmd . '|finally|' . cd . ' ' . s:fnameescape(getcwd()) . '|endtry'
|
|
||||||
endif
|
|
||||||
return cmd . after
|
|
||||||
endif
|
endif
|
||||||
|
return cmd . after
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let s:exec_paths = {}
|
let s:exec_paths = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user