mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #8335 from blueyed/provider
This commit is contained in:
commit
5d6732ff09
@ -51,7 +51,7 @@ function! s:shellify(cmd) abort
|
|||||||
return a:cmd
|
return a:cmd
|
||||||
endif
|
endif
|
||||||
return join(map(copy(a:cmd),
|
return join(map(copy(a:cmd),
|
||||||
\'v:val =~# ''\m[\-.a-zA-Z_/]'' ? shellescape(v:val) : v:val'), ' ')
|
\'v:val =~# ''\m[^\-.a-zA-Z_/]'' ? shellescape(v:val) : v:val'), ' ')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Run a system command and timeout after 30 seconds.
|
" Run a system command and timeout after 30 seconds.
|
||||||
@ -70,7 +70,8 @@ function! s:system(cmd, ...) abort
|
|||||||
let jobid = jobstart(a:cmd, opts)
|
let jobid = jobstart(a:cmd, opts)
|
||||||
|
|
||||||
if jobid < 1
|
if jobid < 1
|
||||||
call health#report_error(printf('Command error (job=%d): %s', jobid, s:shellify(a:cmd)))
|
call health#report_error(printf('Command error (job=%d): `%s` (in %s)',
|
||||||
|
\ jobid, s:shellify(a:cmd), string(getcwd())))
|
||||||
let s:shell_error = 1
|
let s:shell_error = 1
|
||||||
return opts.output
|
return opts.output
|
||||||
endif
|
endif
|
||||||
@ -84,8 +85,8 @@ function! s:system(cmd, ...) abort
|
|||||||
call health#report_error(printf('Command timed out: %s', s:shellify(a:cmd)))
|
call health#report_error(printf('Command timed out: %s', s:shellify(a:cmd)))
|
||||||
call jobstop(jobid)
|
call jobstop(jobid)
|
||||||
elseif s:shell_error != 0 && !ignore_error
|
elseif s:shell_error != 0 && !ignore_error
|
||||||
call health#report_error(printf("Command error (job=%d): %s\nOutput: %s", jobid,
|
call health#report_error(printf("Command error (job=%d): `%s` (in %s)\nOutput: %s",
|
||||||
\ s:shellify(a:cmd), opts.output))
|
\ jobid, s:shellify(a:cmd), string(getcwd()), opts.output))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return opts.output
|
return opts.output
|
||||||
@ -185,7 +186,9 @@ function! s:version_info(python) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let nvim_path = s:trim(s:system([
|
let nvim_path = s:trim(s:system([
|
||||||
\ a:python, '-c', 'import neovim; print(neovim.__file__)']))
|
\ a:python, '-c',
|
||||||
|
\ 'import sys; sys.path.remove(""); ' .
|
||||||
|
\ 'import neovim; print(neovim.__file__)']))
|
||||||
if s:shell_error || empty(nvim_path)
|
if s:shell_error || empty(nvim_path)
|
||||||
return [python_version, 'unable to load neovim Python module', pypi_version,
|
return [python_version, 'unable to load neovim Python module', pypi_version,
|
||||||
\ nvim_path]
|
\ nvim_path]
|
||||||
|
Loading…
Reference in New Issue
Block a user