Skip to content

Commit

Permalink
c syntax_checker: add buffer local variable for custom cflags
Browse files Browse the repository at this point in the history
  • Loading branch information
kongo2002 authored and scrooloose committed Jun 24, 2010
1 parent d4f5aea commit de2b206
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions syntax_checkers/c.vim
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
" libraries like gtk and glib add this line to your .vimrc:
"
" let g:syntastic_c_no_include_search = 1
"
" alternatively you can set the buffer local variable b:syntastic_c_cflags.
" If this variable is set for the current buffer no search for additional
" libraries is done. I.e. set the variable like this:
"
" let b:syntastic_c_cflags = ' -I/usr/include/libsoup-2.4'

if exists('loaded_c_syntax_checker')
finish
Expand Down Expand Up @@ -50,9 +56,13 @@ function! SyntaxCheckers_c_GetLocList()
endif
endif

if !exists('g:syntastic_c_no_include_search') ||
\ g:syntastic_c_no_include_search != 1
let makeprg .= s:SearchHeaders(s:handlers)
if !exists('b:syntastic_c_cflags')
if !exists('g:syntastic_c_no_include_search') ||
\ g:syntastic_c_no_include_search != 1
let makeprg .= s:SearchHeaders(s:handlers)
endif
else
let makeprg .= b:syntastic_c_cflags
endif

return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
Expand Down

0 comments on commit de2b206

Please sign in to comment.