]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(make): add compiler/make.vim to reset compiler plugin settings
authorKonfekt <Konfekt@users.noreply.github.com>
Tue, 10 Sep 2024 19:06:22 +0000 (21:06 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 10 Sep 2024 19:11:28 +0000 (21:11 +0200)
closes: #15645

Co-authored-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/compiler/README.txt
runtime/compiler/make.vim [new file with mode: 0644]
runtime/doc/quickfix.txt
runtime/doc/tags

index dccf4a97629be5c96266c09a700cc8e8275d6468..327d0a7fded57e6d07d707e1912f45c668f8718d 100644 (file)
@@ -4,6 +4,8 @@ They are used with the ":compiler" command.
 These scripts usually set options, for example 'errorformat'.
 See ":help write-compiler-plugin".
 
+To undo the effect of a compiler plugin, use the make compiler plugin.
+
 If you want to write your own compiler plugin, have a look at the other files
 for how to do it, the format is simple.
 
diff --git a/runtime/compiler/make.vim b/runtime/compiler/make.vim
new file mode 100644 (file)
index 0000000..748251b
--- /dev/null
@@ -0,0 +1,13 @@
+" Vim compiler plugin
+"
+" Maintainer:  The Vim Project <https://github.com/vim/vim>
+" Last Change: 2024 Sep 10
+" Original Author: Konfekt
+"
+" This compiler plugin is used to reset previously set compiler options.
+
+if exists("g:current_compiler") | unlet g:current_compiler | endif
+if exists("b:current_compiler") | unlet b:current_compiler | endif
+
+CompilerSet makeprg&
+CompilerSet errorformat&
index 6942a584b5d907aab609df2eea1a8ef3e426dca3..ea5f01d25ecfb6741baf980baf1b531ab1aa48ce 100644 (file)
@@ -1,4 +1,4 @@
-*quickfix.txt*  For Vim version 9.1.  Last change: 2024 Sep 09
+*quickfix.txt*  For Vim version 9.1.  Last change: 2024 Sep 10
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1276,6 +1276,7 @@ not "b:current_compiler".  What the command actually does is the following:
 
 For writing a compiler plugin, see |write-compiler-plugin|.
 
+Use the |compiler-make| plugin to undo the effect of a compiler plugin.
 
 DOTNET                                                 *compiler-dotnet*
 
@@ -1291,7 +1292,6 @@ Example: limit output to only display errors, and suppress the project name: >
        let dotnet_show_project_file = v:false
        compiler dotnet
 <
-
 GCC                                    *quickfix-gcc*  *compiler-gcc*
 
 There's one variable you can set for the GCC compiler:
@@ -1302,7 +1302,6 @@ g:compiler_gcc_ignore_unmatched_lines
                                commands run from make are generating false
                                positives.
 
-
 JAVAC                                                  *compiler-javac*
 
 Commonly used compiler options can be added to 'makeprg' by setting the
@@ -1310,6 +1309,12 @@ g:javac_makeprg_params variable.  For example: >
 
        let g:javac_makeprg_params = "-Xlint:all -encoding utf-8"
 <
+GNU MAKE                                               *compiler-make*
+
+Since the default make program is "make", the compiler plugin for make,
+:compiler make, will reset the 'makeprg' and 'errorformat' option to
+the default values and unlet any variables that may have been set by a
+previous compiler plugin.
 
 MANX AZTEC C                           *quickfix-manx* *compiler-manx*
 
index 77c02a8649a17df9aa8e0a584972471b42604aa3..dd5a0a689463f0441ecfee702fb469cd2cfdeca0 100644 (file)
@@ -6548,6 +6548,7 @@ compiler-gnat     ft_ada.txt      /*compiler-gnat*
 compiler-groff quickfix.txt    /*compiler-groff*
 compiler-hpada ft_ada.txt      /*compiler-hpada*
 compiler-javac quickfix.txt    /*compiler-javac*
+compiler-make  quickfix.txt    /*compiler-make*
 compiler-manx  quickfix.txt    /*compiler-manx*
 compiler-pandoc        quickfix.txt    /*compiler-pandoc*
 compiler-perl  quickfix.txt    /*compiler-perl*