Fix pwsh/powershell test when used with a parameters

Like `set shell=pwsh\ -NoLogo`.
This commit is contained in:
acelya
2021-02-09 21:55:34 +01:00
committed by Andy Stewart
parent d249be7f3c
commit 2e3cd54ed6

View File

@@ -180,7 +180,7 @@ function! s:use_known_shell() abort
let &shell = 'sh' let &shell = 'sh'
set shellcmdflag=-c shellredir=>%s\ 2>&1 set shellcmdflag=-c shellredir=>%s\ 2>&1
endif endif
if has('win32') && (&shell ==# 'pwsh' || &shell ==# 'powershell') if has('win32') && (&shell =~# 'pwsh' || &shell =~# 'powershell')
let [s:shell, s:shellcmdflag, s:shellredir, s:shellpipe, s:shellquote, s:shellxquote] = [&shell, &shellcmdflag, &shellredir, &shellpipe, &shellquote, &shellxquote] let [s:shell, s:shellcmdflag, s:shellredir, s:shellpipe, s:shellquote, s:shellxquote] = [&shell, &shellcmdflag, &shellredir, &shellpipe, &shellquote, &shellxquote]
let &shell = 'cmd.exe' let &shell = 'cmd.exe'
set shellcmdflag=/s\ /c shellredir=>%s\ 2>&1 shellpipe=>%s\ 2>&1 shellquote= shellxquote=" set shellcmdflag=/s\ /c shellredir=>%s\ 2>&1 shellpipe=>%s\ 2>&1 shellquote= shellxquote="