added possibility to check header files

This commit is contained in:
kongo2002 2009-12-21 02:19:53 +08:00 committed by Martin Grenfell
parent 2aae51681b
commit 4dbe8baf4d

View File

@ -19,13 +19,17 @@ if !executable("gcc")
endif endif
function! SyntaxCheckers_c_GetLocList() function! SyntaxCheckers_c_GetLocList()
" only check c files
if expand('%') =~ '.h$'
return []
endif
let makeprg = 'gcc -fsyntax-only %' let makeprg = 'gcc -fsyntax-only %'
let errorformat = '%-G%f:%s:,%f:%l: %m' let errorformat = '%-G%f:%s:,%f:%l: %m'
if expand('%') =~ '.h$'
if exists('g:syntastic_c_check_header')
let makeprg = 'gcc -c %'
else
return []
endif
endif
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction