mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 05:43:52 -05:00
Use jobs for FileReadCmd
This commit is contained in:
@@ -2464,11 +2464,18 @@ function! fugitive#FileReadCmd(...) abort
|
|||||||
return 'noautocmd ' . line . 'read ' . s:fnameescape(amatch)
|
return 'noautocmd ' . line . 'read ' . s:fnameescape(amatch)
|
||||||
endif
|
endif
|
||||||
if rev !~# ':' && s:ChompDefault('', [dir, 'cat-file', '-t', rev]) =~# '^\%(commit\|tag\)$'
|
if rev !~# ':' && s:ChompDefault('', [dir, 'cat-file', '-t', rev]) =~# '^\%(commit\|tag\)$'
|
||||||
let cmd = fugitive#ShellCommand([dir, 'log', '--pretty=format:%B', '-1', rev, '--'])
|
let cmd = [dir, 'log', '--pretty=format:%B', '-1', rev, '--']
|
||||||
else
|
else
|
||||||
let cmd = fugitive#ShellCommand([dir, 'cat-file', '-p', rev, '--'])
|
let cmd = [dir, 'cat-file', '-p', rev, '--']
|
||||||
|
endif
|
||||||
|
let temp = tempname()
|
||||||
|
let [err, exec_error] = s:StdoutToFile(temp, cmd)
|
||||||
|
if exec_error
|
||||||
|
call delete(temp)
|
||||||
|
return 'noautocmd ' . line . 'read ' . s:fnameescape(amatch)
|
||||||
|
else
|
||||||
|
return 'silent keepalt ' . line . 'read ' . s:fnameescape(temp) . '|call delete(' . string(temp) . ')'
|
||||||
endif
|
endif
|
||||||
return line . 'read !' . escape(cmd, '!#%')
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fugitive#FileWriteCmd(...) abort
|
function! fugitive#FileWriteCmd(...) abort
|
||||||
|
|||||||
Reference in New Issue
Block a user