1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-13 18:25:42 +08:00

fix(lang#c): fix clang_std option

close https://github.com/SpaceVim/SpaceVim/issues/4335
This commit is contained in:
Shidong Wang 2021-10-16 23:39:05 +08:00
parent 2ae9a354f8
commit 0d2f90825e
No known key found for this signature in database
GPG Key ID: 41BB7053E835C848

View File

@ -345,9 +345,14 @@ endfunction
" local function: update_checkers_argv {{{
if g:spacevim_lint_engine ==# 'neomake'
function! s:update_checkers_argv(argv, fts) abort
if s:has_std(a:argv)
let default_std = 1
else
let default_std = 0
endif
for ft in a:fts
let g:neomake_{ft}_clang_maker = {
\ 'args': ['-fsyntax-only', '-Wall', '-Wextra', '-I./'] + a:argv,
\ 'args': ['-fsyntax-only', '-Wall', '-Wextra', '-I./'] + a:argv + (default_std ? [] : ['-std=' . s:clang_std[ft]]) + s:clang_flag,
\ 'exe' : s:clang_executable,
\ 'errorformat':
\ '%-G%f:%s:,' .