Commit: patch 9.1.1158: :verbose set has wrong file name with :compiler!

2 views
Skip to first unread message

Christian Brabandt

unread,
Feb 28, 2025, 11:45:19 AM2/28/25
to vim...@googlegroups.com
patch 9.1.1158: :verbose set has wrong file name with :compiler!

Commit: https://github.com/vim/vim/commit/5e8b2268e180cbf5079ea6dbe9c8fd29c3e3133c
Author: zeertzjq <zeer...@outlook.com>
Date: Fri Feb 28 17:32:07 2025 +0100

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 <zeer...@outlook.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 068115317..567522c22 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -789,7 +789,7 @@ ex_compiler(exarg_T *eap)
{
// ":compiler! {name}" sets global options
do_cmdline_cmd((char_u *)
- "command -nargs=* CompilerSet set <args>");
+ "command -nargs=* -keepscript CompilerSet set <args>");
}
else
{
diff --git a/src/testdir/test_compiler.vim b/src/testdir/test_compiler.vim
index 99f472401..d86c55f1c 100644
--- a/src/testdir/test_compiler.vim
+++ b/src/testdir/test_compiler.vim
@@ -17,12 +17,14 @@ func Test_compiler()
e Xfoo.pl
" Play nice with other tests.
defer setqflist([])
+
compiler perl
call assert_equal('perl', b:current_compiler)
call assert_fails('let g:current_compiler', 'E121:')
-
let verbose_efm = execute('verbose set efm')
call assert_match('Last set from .*[/\]compiler[/\]perl.vim ', verbose_efm)
+ " Not using the global value
+ call assert_notequal('', &l:efm)

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

+ compiler make
+ call assert_fails('let b:current_compiler', 'E121:')
+ call assert_fails('let g:current_compiler', 'E121:')
+ let verbose_efm = execute('verbose set efm')
+ call assert_match('Last set from .*[/\]compiler[/\]make.vim ', verbose_efm)
+
+ compiler! perl
+ call assert_equal('perl', b:current_compiler)
+ call assert_equal('perl', g:current_compiler)
+ let verbose_efm = execute('verbose set efm')
+ call assert_match('Last set from .*[/\]compiler[/\]perl.vim ', verbose_efm)
+ call assert_equal(verbose_efm, execute('verbose setglobal efm'))
+ " Using the global value
+ call assert_equal('', &l:efm)
+
+ compiler! make
+ call assert_fails('let b:current_compiler', 'E121:')
+ call assert_fails('let g:current_compiler', 'E121:')
+ let verbose_efm = execute('verbose set efm')
+ call assert_match('Last set from .*[/\]compiler[/\]make.vim ', verbose_efm)
+ call assert_equal(verbose_efm, execute('verbose setglobal efm'))
+ " Using the global value
+ call assert_equal('', &l:efm)

let &shellslash = save_shellslash
call delete('Xfoo.pl')
diff --git a/src/version.c b/src/version.c
index 94db286ee..3b61cdd8e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1158,
/**/
1157,
/**/
Reply all
Reply to author
Forward
0 new messages