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>
diff --git a/runtime/compiler/bdf.vim b/runtime/compiler/bdf.vim
index b062e84..7e08cdd 100644
--- a/runtime/compiler/bdf.vim
+++ b/runtime/compiler/bdf.vim
@@ -1,7 +1,8 @@
" Vim compiler file
" Compiler: BDF to PCF Conversion
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2006-04-19
+" Contributors: Enno Nagel
+" Last Change: 2024 Mar 29
if exists("current_compiler")
finish
@@ -11,9 +12,12 @@
let s:cpo_save = &cpo
set cpo-=C
-setlocal makeprg=bdftopcf\ $*
+if exists(":CompilerSet") != 2 " Older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
-setlocal errorformat=%ABDF\ %trror\ on\ line\ %l:\ %m,
+CompilerSet makeprg=bdftopcf\ $*
+CompilerSet errorformat=%ABDF\ %trror\ on\ line\ %l:\ %m,
\%-Z%p^,
\%Cbdftopcf:\ bdf\ input\\,\ %f\\,\ corrupt,
\%-G%.%#