Skip to content

Commit 84baba3

Browse files
Konfektchrisbra
authored andcommitted
runtime(compiler): do not override &l:makeprg on :compiler!
closes: #18686 Signed-off-by: Konfekt <Konfekt@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 7dfdc7f commit 84baba3

4 files changed

Lines changed: 16 additions & 14 deletions

File tree

runtime/compiler/cppcheck.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" vim compiler file
22
" Compiler: cppcheck (C++ static checker)
33
" Maintainer: Vincent B. (twinside@free.fr)
4-
" Last Change: 2024 Nov 19 by @Konfekt
4+
" Last Change: 2025 Nov 06 by @Konfekt
55

66
if exists("current_compiler") | finish | endif
77
let current_compiler = "cppcheck"
@@ -18,14 +18,14 @@ if !exists('g:c_cppcheck_params')
1818
let s:undo_compiler = 'unlet! g:c_cppcheck_params'
1919
endif
2020

21-
let &l:makeprg = 'cppcheck --quiet'
21+
exe 'CompilerSet makeprg=' .. escape('cppcheck --quiet'
2222
\ ..' --template="{file}:{line}:{column}: {severity}: [{id}] {message} {callstack}"'
2323
\ ..' '..get(b:, 'c_cppcheck_params', get(g:, 'c_cppcheck_params', (&filetype ==# 'cpp' ? ' --language=c++' : '')))
2424
\ ..' '..get(b:, 'c_cppcheck_includes', get(g:, 'c_cppcheck_includes',
2525
\ (filereadable('compile_commands.json') ? '--project=compile_commands.json' :
2626
\ (!empty(glob('*'..s:slash..'compile_commands.json', 1, 1)) ? '--project='..glob('*'..s:slash..'compile_commands.json', 1, 1)[0] :
27-
\ (empty(&path) ? '' : '-I')..join(map(filter(split(&path, ','), 'isdirectory(v:val)'),'shellescape(v:val)'), ' -I')))))
28-
exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"')
27+
\ (empty(&path) ? '' : '-I')..join(map(filter(split(&path, ','), 'isdirectory(v:val)'),'shellescape(v:val)'), ' -I'))))),
28+
\ ' \|"')
2929

3030
CompilerSet errorformat=
3131
\%f:%l:%c:\ %tarning:\ %m,

runtime/compiler/mypy.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Vim compiler file
22
" Compiler: Mypy (Python static checker)
33
" Maintainer: @Konfekt
4-
" Last Change: 2024 Nov 19
4+
" Last Change: 2025 Nov 06
55

66
if exists("current_compiler") | finish | endif
77
let current_compiler = "mypy"
@@ -10,9 +10,9 @@ let s:cpo_save = &cpo
1010
set cpo&vim
1111

1212
" CompilerSet makeprg=mypy
13-
let &l:makeprg = 'mypy --show-column-numbers '
14-
\ ..get(b:, 'mypy_makeprg_params', get(g:, 'mypy_makeprg_params', '--strict --ignore-missing-imports'))
15-
exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"')
13+
exe 'CompilerSet makeprg=' .. escape('mypy --show-column-numbers '
14+
\ ..get(b:, 'mypy_makeprg_params', get(g:, 'mypy_makeprg_params', '--strict --ignore-missing-imports')),
15+
\ ' \|"')
1616
CompilerSet errorformat=%f:%l:%c:\ %t%*[^:]:\ %m
1717

1818
let &cpo = s:cpo_save

runtime/compiler/pylint.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
" Maintainer: Daniel Moch <daniel@danielmoch.com>
44
" Last Change: 2024 Nov 07 by The Vim Project (added params variable)
55
" 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
6+
" 2025 Nov 06 by the Vim Project (do not set buffer-local makeprg)
67

78
if exists("current_compiler") | finish | endif
89
let current_compiler = "pylint"
@@ -11,10 +12,10 @@ let s:cpo_save = &cpo
1112
set cpo&vim
1213

1314
" CompilerSet makeprg=ruff
14-
let &l:makeprg = 'pylint ' .
15+
exe 'CompilerSet makeprg=' .. escape('pylint ' .
1516
\ '--output-format=text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" --reports=no ' .
16-
\ get(b:, "pylint_makeprg_params", get(g:, "pylint_makeprg_params", '--jobs=0'))
17-
exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"')
17+
\ get(b:, "pylint_makeprg_params", get(g:, "pylint_makeprg_params", '--jobs=0')),
18+
\ ' \|"')
1819
CompilerSet errorformat=%A%f:%l:%c:%t:\ %m,%A%f:%l:\ %m,%A%f:(%l):\ %m,%-Z%p^%.%#,%-G%.%#
1920

2021
let &cpo = s:cpo_save

runtime/compiler/ruff.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
" Maintainer: @pbnj-dragon
44
" Last Change: 2024 Nov 07
55
" 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
6+
" 2025 Nov 06 by the Vim Project (do not set buffer-local makeprg)
67

78
if exists("current_compiler") | finish | endif
89
let current_compiler = "ruff"
@@ -11,9 +12,9 @@ let s:cpo_save = &cpo
1112
set cpo&vim
1213

1314
" CompilerSet makeprg=ruff
14-
let &l:makeprg= 'ruff check --output-format=concise '
15-
\ ..get(b:, 'ruff_makeprg_params', get(g:, 'ruff_makeprg_params', '--preview'))
16-
exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"')
15+
exe 'CompilerSet makeprg=' .. escape('ruff check --output-format=concise '
16+
\ ..get(b:, 'ruff_makeprg_params', get(g:, 'ruff_makeprg_params', '--preview')),
17+
\ ' \|"')
1718
CompilerSet errorformat=%f:%l:%c:\ %m,%f:%l:\ %m,%f:%l:%c\ -\ %m,%f:
1819

1920
let &cpo = s:cpo_save

0 commit comments

Comments
 (0)