Update env workarounds for nvim

Commit e85c8dff692c894a614192f6dd8a4c71c1c9fe30 in the neovim repository
appears to have addressed the bugs that prevent us from providing a
custom environment for a job.  This hasn't made it into a stable release
yet, so let's assume it will land in the next minor version.
This commit is contained in:
Tim Pope
2021-03-19 02:40:27 -04:00
parent d70c42aa50
commit 91089715f4

View File

@@ -404,7 +404,7 @@ endfunction
function! s:JobOpts(cmd, env) abort
if empty(a:env)
return [a:cmd, {}]
elseif has('patch-8.2.0239') || has('patch-8.1.0902') && !has('nvim') && (!has('win32') || empty(filter(keys(a:env), 'exists("$" . v:val)')))
elseif has('patch-8.2.0239') || has('nvim-0.5.0') || has('patch-8.1.0902') && !has('nvim') && (!has('win32') || empty(filter(keys(a:env), 'exists("$" . v:val)')))
return [a:cmd, {'env': a:env}]
endif
let envlist = map(items(a:env), 'join(v:val, "=")')