cpp: add option to remove include errors
This commit is contained in:
parent
d81b360f64
commit
441506c061
@ -45,6 +45,12 @@
|
|||||||
" checking execution via the variable 'g:syntastic_cpp_compiler_options':
|
" checking execution via the variable 'g:syntastic_cpp_compiler_options':
|
||||||
"
|
"
|
||||||
" let g:syntastic_cpp_compiler_options = ' -std=c++0x'
|
" let g:syntastic_cpp_compiler_options = ' -std=c++0x'
|
||||||
|
"
|
||||||
|
" Using the global variable 'g:syntastic_cpp_remove_include_errors' you can
|
||||||
|
" specify whether errors of files included via the
|
||||||
|
" g:syntastic_cpp_include_dirs' setting are removed from the result set:
|
||||||
|
"
|
||||||
|
" let g:syntastic_cpp_remove_include_errors = 1
|
||||||
|
|
||||||
if exists('loaded_cpp_syntax_checker')
|
if exists('loaded_cpp_syntax_checker')
|
||||||
finish
|
finish
|
||||||
@ -93,7 +99,18 @@ function! SyntaxCheckers_cpp_GetLocList()
|
|||||||
let makeprg .= b:syntastic_cpp_cflags
|
let makeprg .= b:syntastic_cpp_cflags
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
" process makeprg
|
||||||
|
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||||
|
\ 'errorformat': errorformat })
|
||||||
|
|
||||||
|
" filter the processed errors if desired
|
||||||
|
if exists('g:syntastic_cpp_remove_include_errors') &&
|
||||||
|
\ g:syntastic_cpp_remove_include_errors != 0
|
||||||
|
return filter(errors,
|
||||||
|
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
|
||||||
|
else
|
||||||
|
return errors
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user