Support both spaces and quotes in &shell

Pass the git command to `jobstart()` as a string, not a list.
`jobstart()` does some kind of internal black magic to parse strings
like `'"/usr/bin/env bash" -l'`, whereas it would be impossible to pass
in an equivalent argument using a list.
This commit is contained in:
Greg Werbin
2016-04-17 20:12:51 -04:00
committed by Andy Stewart
parent 16e69e6571
commit 103acc7a23

View File

@@ -132,7 +132,9 @@ function! gitgutter#diff#run_diff(realtime, preserve_full_diff)
" Note that when `cmd` doesn't produce any output, i.e. the diff is empty, " Note that when `cmd` doesn't produce any output, i.e. the diff is empty,
" the `stdout` event is not fired on the job handler. Therefore we keep " the `stdout` event is not fired on the job handler. Therefore we keep
" track of the jobs ourselves so we can spot empty diffs. " track of the jobs ourselves so we can spot empty diffs.
let job_id = jobstart(split(&shell) + ['-c', cmd], {
let job_cmd = &shell . ' -c ' . cmd
let job_id = jobstart(job_cmd, {
\ 'on_stdout': function('gitgutter#handle_diff_job'), \ 'on_stdout': function('gitgutter#handle_diff_job'),
\ 'on_stderr': function('gitgutter#handle_diff_job'), \ 'on_stderr': function('gitgutter#handle_diff_job'),
\ 'on_exit': function('gitgutter#handle_diff_job') \ 'on_exit': function('gitgutter#handle_diff_job')