Skip to content

Commit 077d1d2

Browse files
Konfektk-takata
authored andcommitted
runtime(make): add compiler/make.vim to reset compiler plugin settings
closes: #15645 Co-authored-by: K.Takata <[email protected]> Signed-off-by: Konfekt <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent a9ae38d commit 077d1d2

4 files changed

Lines changed: 24 additions & 3 deletions

File tree

runtime/compiler/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ They are used with the ":compiler" command.
44
These scripts usually set options, for example 'errorformat'.
55
See ":help write-compiler-plugin".
66

7+
To undo the effect of a compiler plugin, use the make compiler plugin.
8+
79
If you want to write your own compiler plugin, have a look at the other files
810
for how to do it, the format is simple.
911

runtime/compiler/make.vim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
" Vim compiler plugin
2+
"
3+
" Maintainer: The Vim Project <https://github.com/vim/vim>
4+
" Last Change: 2024 Sep 10
5+
" Original Author: Konfekt
6+
"
7+
" This compiler plugin is used to reset previously set compiler options.
8+
9+
if exists("g:current_compiler") | unlet g:current_compiler | endif
10+
if exists("b:current_compiler") | unlet b:current_compiler | endif
11+
12+
CompilerSet makeprg&
13+
CompilerSet errorformat&

runtime/doc/quickfix.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*quickfix.txt* For Vim version 9.1. Last change: 2024 Sep 09
1+
*quickfix.txt* For Vim version 9.1. Last change: 2024 Sep 10
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1276,6 +1276,7 @@ not "b:current_compiler". What the command actually does is the following:
12761276

12771277
For writing a compiler plugin, see |write-compiler-plugin|.
12781278

1279+
Use the |compiler-make| plugin to undo the effect of a compiler plugin.
12791280

12801281
DOTNET *compiler-dotnet*
12811282

@@ -1291,7 +1292,6 @@ Example: limit output to only display errors, and suppress the project name: >
12911292
let dotnet_show_project_file = v:false
12921293
compiler dotnet
12931294
<
1294-
12951295
GCC *quickfix-gcc* *compiler-gcc*
12961296

12971297
There's one variable you can set for the GCC compiler:
@@ -1302,14 +1302,19 @@ g:compiler_gcc_ignore_unmatched_lines
13021302
commands run from make are generating false
13031303
positives.
13041304

1305-
13061305
JAVAC *compiler-javac*
13071306

13081307
Commonly used compiler options can be added to 'makeprg' by setting the
13091308
g:javac_makeprg_params variable. For example: >
13101309
13111310
let g:javac_makeprg_params = "-Xlint:all -encoding utf-8"
13121311
<
1312+
GNU MAKE *compiler-make*
1313+
1314+
Since the default make program is "make", the compiler plugin for make,
1315+
:compiler make, will reset the 'makeprg' and 'errorformat' option to
1316+
the default values and unlet any variables that may have been set by a
1317+
previous compiler plugin.
13131318

13141319
MANX AZTEC C *quickfix-manx* *compiler-manx*
13151320

runtime/doc/tags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6548,6 +6548,7 @@ compiler-gnat ft_ada.txt /*compiler-gnat*
65486548
compiler-groff quickfix.txt /*compiler-groff*
65496549
compiler-hpada ft_ada.txt /*compiler-hpada*
65506550
compiler-javac quickfix.txt /*compiler-javac*
6551+
compiler-make quickfix.txt /*compiler-make*
65516552
compiler-manx quickfix.txt /*compiler-manx*
65526553
compiler-pandoc quickfix.txt /*compiler-pandoc*
65536554
compiler-perl quickfix.txt /*compiler-perl*

0 commit comments

Comments
 (0)