[vim] Fix version check on windows/powershell (#2894)

- Replace fzf#shellescape with shellescape
- Prepend command with '&' in powershell to deal with quoted exe
This commit is contained in:
Carl Kamholtz 2022-07-29 09:18:06 +10:00 committed by GitHub
parent ecc418ba77
commit 728f735281
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -164,7 +164,7 @@ function s:get_version(bin)
if has_key(s:versions, a:bin)
return s:versions[a:bin]
end
let command = fzf#shellescape(a:bin) . ' --version --no-height'
let command = (&shell == 'powershell' ? '&' : '') . shellescape(a:bin) . ' --version --no-height'
let output = systemlist(command)
if v:shell_error || empty(output)
return ''