mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-14 14:23:51 -05:00
Fix command execution on Vim 7
This worked on my test environment of 7.4.888, but did not work on 7.4.000. References: https://github.com/tpope/vim-fugitive/issues/1889
This commit is contained in:
@@ -341,12 +341,19 @@ function! s:JobExecute(argv, jopts, stdin, callback, ...) abort
|
||||
let cmd = s:shellesc(a:argv)
|
||||
let outfile = tempname()
|
||||
try
|
||||
let dict.stderr = split(system(' (' . cmd . ' >' . outfile . ') ', join(a:stdin, "\n")), "\n", 1)
|
||||
if len(a:stdin)
|
||||
call writefile(a:stdin, outfile . '.in', 'b')
|
||||
let cmd = ' (' . cmd . ' >' . outfile . ' <' . outfile . '.in) '
|
||||
else
|
||||
let cmd = ' (' . cmd . ' >' . outfile . ') '
|
||||
endif
|
||||
let dict.stderr = split(system(cmd), "\n", 1)
|
||||
let dict.exit_status = v:shell_error
|
||||
let dict.stdout = readfile(outfile, 'b')
|
||||
call call(cb[0], [dict] + cb[1:-1])
|
||||
finally
|
||||
call delete(outfile)
|
||||
call delete(outfile . '.in')
|
||||
endtry
|
||||
endif
|
||||
if empty(a:callback)
|
||||
|
||||
Reference in New Issue
Block a user