From f047d8250dd94b647d49334595f6d4ce364b8aa4 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 17 Aug 2021 16:55:09 -0400 Subject: [PATCH] Improve check for job environment variable support The patch specified was incorrect for Vim, and this api_info() malarkey appears to be the only way to check for Neovim 0.5.0 proper. --- autoload/fugitive.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index b944e94..508554e 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -610,7 +610,9 @@ endfunction function! s:JobOpts(cmd, env) abort if empty(a:env) return [a:cmd, {}] - elseif has('patch-8.2.0239') || has('nvim-0.5.1') || 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') && api_info().version.api_level - api_info().version.api_prerelease >= 7 || + \ has('patch-8.0.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, "=")')