diff options
Diffstat (limited to 'compiler/powershell.vim')
-rw-r--r-- | compiler/powershell.vim | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/compiler/powershell.vim b/compiler/powershell.vim index 4d9d76b0..1737a5a5 100644 --- a/compiler/powershell.vim +++ b/compiler/powershell.vim @@ -17,21 +17,28 @@ let s:cpo_save = &cpo set cpo-=C if !exists("g:ps1_makeprg_cmd") - if !has('win32') || executable('pwsh') + if executable('pwsh') " pwsh is the future let g:ps1_makeprg_cmd = 'pwsh' + elseif executable('pwsh.exe') + let g:ps1_makeprg_cmd = 'pwsh.exe' + elseif executable('powershell.exe') + let g:ps1_makeprg_cmd = 'powershell.exe' else - " powershell is Windows-only - let g:ps1_makeprg_cmd = 'powershell' + let g:ps1_makeprg_cmd = '' endif endif +if !executable(g:ps1_makeprg_cmd) + echoerr "To use the powershell compiler, please set g:ps1_makeprg_cmd to the powershell executable!" +endif + " Show CategoryInfo, FullyQualifiedErrorId, etc? let g:ps1_efm_show_error_categories = get(g:, 'ps1_efm_show_error_categories', 0) " Use absolute path because powershell requires explicit relative paths " (./file.ps1 is okay, but # expands to file.ps1) -let &l:makeprg = g:ps1_makeprg_cmd .' %:p' +let &l:makeprg = g:ps1_makeprg_cmd .' %:p:S' " Parse file, line, char from callstacks: " Write-Ouput : The term 'Write-Ouput' is not recognized as the name of a |