# HG changeset patch # User Christian Brabandt # Date 1712340903 -7200 # Node ID e75d871c5b91d06ea4d72377259402a0d8a6aba1 # Parent 99bf06d67e43fd8043750a482927238a49c0ed0d runtime: fix :compiler leaving behind a g:makeprg variable (#14414) Commit: https://github.com/vim/vim/commit/b73faa1c02d0911a60bddd1ba343cf620f2cd124 Author: zeertzjq Date: Sat Apr 6 02:01:16 2024 +0800 runtime: fix :compiler leaving behind a g:makeprg variable (https://github.com/vim/vim/issues/14414) Problem: :compiler may leave behind a g:makeprg variable after https://github.com/vim/vim/issues/14336. Solution: Use a script local variable. Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt diff --git a/runtime/compiler/powershell.vim b/runtime/compiler/powershell.vim --- a/runtime/compiler/powershell.vim +++ b/runtime/compiler/powershell.vim @@ -4,6 +4,7 @@ " Contributors: Enno Nagel " Last Change: 2024 Mar 29 " 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) +" 2024 Apr 05 by The Vim Project (avoid leaving behind g:makeprg) if exists("current_compiler") finish @@ -35,7 +36,7 @@ let g:ps1_efm_show_error_categories = ge " Use absolute path because powershell requires explicit relative paths " (./file.ps1 is okay, but # expands to file.ps1) -let makeprg = g:ps1_makeprg_cmd .. ' %:p:S' +let s: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 @@ -48,7 +49,7 @@ let makeprg = g:ps1_makeprg_cmd .. ' %:p " + CategoryInfo : ObjectNotFound: (Write-Ouput:String) [], CommandNotFoundException " + FullyQualifiedErrorId : CommandNotFoundException -execute 'CompilerSet makeprg=' .. escape(makeprg, ' ') +execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' ') " Showing error in context with underlining. CompilerSet errorformat=%+G+%m diff --git a/runtime/compiler/tex.vim b/runtime/compiler/tex.vim --- a/runtime/compiler/tex.vim +++ b/runtime/compiler/tex.vim @@ -4,6 +4,7 @@ " Contributors: Enno Nagel " Last Change: 2024 Mar 29 " 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) +" 2024 Apr 05 by The Vim Project (avoid leaving behind g:makeprg) if exists("current_compiler") finish @@ -25,8 +26,8 @@ if exists('b:tex_ignore_makefile') || ex else let current_compiler = "latex" endif - let makeprg=current_compiler .. ' -interaction=nonstopmode' - execute 'CompilerSet makeprg=' .. escape(makeprg, ' ') + let s:makeprg=current_compiler .. ' -interaction=nonstopmode' + execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' ') else let current_compiler = 'make' endif