From 748ca4501943cdf0b699917bfebe514d2c4b0fc9 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Fri, 16 Aug 2019 09:16:56 +0200 Subject: [PATCH] Fix support for very old Vim versions Fixes https://github.com/mhinz/vim-signify/issues/304 --- autoload/sy/repo.vim | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/autoload/sy/repo.vim b/autoload/sy/repo.vim index 635c99c..f08b5dc 100644 --- a/autoload/sy/repo.vim +++ b/autoload/sy/repo.vim @@ -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