Fix support for very old Vim versions

Fixes https://github.com/mhinz/vim-signify/issues/304
This commit is contained in:
Marco Hinz 2019-08-16 09:16:56 +02:00
parent cd155d3edc
commit 748ca45019
No known key found for this signature in database
GPG Key ID: 1C980A1B657B4A4F

View File

@ -42,18 +42,17 @@ endfunction
" Function: sy#get_diff {{{1
function! sy#repo#get_diff(vcs, func) abort
call sy#verbose('sy#repo#get_diff()', a:vcs)
let job_id = get(b:, 'sy_job_id_'.a:vcs)
let [cmd, options] = s:initialize_job(a:vcs)
let options.func = a:func
" Neovim
if has('nvim')
if job_id
silent! call jobstop(job_id)
endif
let [cmd, options] = s:initialize_job(a:vcs)
let options.func = a:func
let [cwd, chdir] = sy#util#chdir()
call sy#verbose(['CMD: '. string(cmd), 'CMD DIR: '. b:sy.info.dir, 'ORIG DIR: '. cwd], a:vcs)
try
@ -76,10 +75,7 @@ function! sy#repo#get_diff(vcs, func) abort
silent! call job_stop(job_id)
endif
let [cmd, options] = s:initialize_job(a:vcs)
let options.func = a:func
let [cwd, chdir] = sy#util#chdir()
call sy#verbose(['CMD: '. string(cmd), 'CMD DIR: '. b:sy.info.dir, 'ORIG DIR: '. cwd], a:vcs)
try
@ -100,8 +96,8 @@ function! sy#repo#get_diff(vcs, func) abort
" Older Vim
else
let diff = split(s:run(a:vcs), '\n')
call sy#repo#get_diff_{a:vcs}(b:sy, v:shell_error, diff)
let options.stdoutbuf = split(s:run(a:vcs), '\n')
call s:handle_diff(options, v:shell_error)
endif
endfunction