0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

runtime(compilers): ensure compiler! sets global options (#14336)

Previously some options were only set locally by
&l:makeprg/errorformat

This suffices for :compiler (without a trailing bang)
but falls short for :compiler! that sets &g:makeprg/errorformat as
well

Also apply kind suggestions by @dkearns and @lifepillar 

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Enno
2024-03-31 18:37:05 +02:00
committed by GitHub
parent 80aabaab66
commit 18d730d7b5
6 changed files with 34 additions and 16 deletions

View File

@@ -1,7 +1,8 @@
" Vim compiler file
" Compiler: powershell
" URL: https://github.com/PProvost/vim-ps1
" Last Change: 2020 Mar 30
" Contributors: Enno Nagel
" Last Change: 2024 Mar 29
if exists("current_compiler")
finish
@@ -37,7 +38,7 @@ 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:S'
let 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
@@ -50,6 +51,8 @@ let &l:makeprg = g:ps1_makeprg_cmd .' %:p:S'
" + CategoryInfo : ObjectNotFound: (Write-Ouput:String) [], CommandNotFoundException
" + FullyQualifiedErrorId : CommandNotFoundException
execute 'CompilerSet makeprg=' .. escape(makeprg, ' ')
" Showing error in context with underlining.
CompilerSet errorformat=%+G+%m
" Error summary.