Skip to content

Commit 5e8b226

Browse files
zeertzjqchrisbra
authored andcommitted
patch 9.1.1158: :verbose set has wrong file name with :compiler!
Problem: :verbose set has wrong file name with :compiler! Solution: Add -keepscript (zeertzjq) closes: #16752 Signed-off-by: zeertzjq <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent da53af5 commit 5e8b226

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

src/ex_cmds2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ ex_compiler(exarg_T *eap)
789789
{
790790
// ":compiler! {name}" sets global options
791791
do_cmdline_cmd((char_u *)
792-
"command -nargs=* CompilerSet set <args>");
792+
"command -nargs=* -keepscript CompilerSet set <args>");
793793
}
794794
else
795795
{

src/testdir/test_compiler.vim

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ func Test_compiler()
1717
e Xfoo.pl
1818
" Play nice with other tests.
1919
defer setqflist([])
20+
2021
compiler perl
2122
call assert_equal('perl', b:current_compiler)
2223
call assert_fails('let g:current_compiler', 'E121:')
23-
2424
let verbose_efm = execute('verbose set efm')
2525
call assert_match('Last set from .*[/\\]compiler[/\\]perl.vim ', verbose_efm)
26+
" Not using the global value
27+
call assert_notequal('', &l:efm)
2628

2729
call setline(1, ['#!/usr/bin/perl -w', 'use strict;', 'my $foo=1'])
2830
w!
@@ -36,6 +38,29 @@ func Test_compiler()
3638
call assert_match('\n \d\+ Xfoo.pl:3: Global symbol "$foo" '
3739
\ . 'requires explicit package name', a)
3840

41+
compiler make
42+
call assert_fails('let b:current_compiler', 'E121:')
43+
call assert_fails('let g:current_compiler', 'E121:')
44+
let verbose_efm = execute('verbose set efm')
45+
call assert_match('Last set from .*[/\\]compiler[/\\]make.vim ', verbose_efm)
46+
47+
compiler! perl
48+
call assert_equal('perl', b:current_compiler)
49+
call assert_equal('perl', g:current_compiler)
50+
let verbose_efm = execute('verbose set efm')
51+
call assert_match('Last set from .*[/\\]compiler[/\\]perl.vim ', verbose_efm)
52+
call assert_equal(verbose_efm, execute('verbose setglobal efm'))
53+
" Using the global value
54+
call assert_equal('', &l:efm)
55+
56+
compiler! make
57+
call assert_fails('let b:current_compiler', 'E121:')
58+
call assert_fails('let g:current_compiler', 'E121:')
59+
let verbose_efm = execute('verbose set efm')
60+
call assert_match('Last set from .*[/\\]compiler[/\\]make.vim ', verbose_efm)
61+
call assert_equal(verbose_efm, execute('verbose setglobal efm'))
62+
" Using the global value
63+
call assert_equal('', &l:efm)
3964

4065
let &shellslash = save_shellslash
4166
call delete('Xfoo.pl')

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
1158,
707709
/**/
708710
1157,
709711
/**/

0 commit comments

Comments
 (0)