From 14dc82fc4e6c0c08078f97a24a6c1639c1cc5113 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 14 Apr 2020 13:17:26 +0200 Subject: Update --- compiler/powershell.vim | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'compiler/powershell.vim') 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 -- cgit v1.2.3