diff --git a/autoload/coc/powershell.vim b/autoload/coc/powershell.vim index 710c4f6..ed7d1e9 100644 --- a/autoload/coc/powershell.vim +++ b/autoload/coc/powershell.vim @@ -7,16 +7,25 @@ let s:is_vim = !has('nvim') let s:install_script = s:root.'/install.ps1' function! coc#powershell#install(...) - if(exists('a:1.preview') && a:1.preview) - let s:flags = '-AllowPreRelease' - else - let s:flags = '' + let s:flags = '' + if(exists('a:1')) + let paramType = type(a:1) + " Type 1 seems to be a string... + if(paramType == 1) + if(a:1 == 'preview') + let s:flags = '-AllowPreRelease' + endif + " Type 4 is a dictionary... + elseif(s:paramType == 4) + if(exists('a:1.preview') && a:1.preview) + let s:flags = '-AllowPreRelease' + endif + endif endif - let s:powershell_executable = '' + let s:powershell_executable = 'pwsh' if(exists('a:1.powershellExecutable')) let s:powershell_executable = a:1.powershellExecutable else - let s:powershell_executable = 'pwsh' if(s:is_win) let s:powershell_executable = "powershell" if(executable("pwsh"))