Permalink
Browse files

c syntax_checker: add support for glade

  • Loading branch information...
1 parent bd93029 commit 101955648e448c1b1d57e2d2c47aeb6a44655733 @kongo2002 kongo2002 committed with scrooloose Mar 26, 2010
Showing with 14 additions and 0 deletions.
  1. +14 −0 syntax_checkers/c.vim
View
@@ -41,6 +41,7 @@ function! s:Init()
call s:RegHandler('\%(gtk\|glib\)', s:CheckGtk())
call s:RegHandler('ruby', s:CheckRuby())
call s:RegHandler('Python\.h', s:CheckPython())
+ call s:RegHandler('glade', s:CheckGlade())
unlet! s:RegHandler
endfunction
@@ -154,6 +155,19 @@ function! s:CheckPython()
return ''
endfunction
+" try to find the glade headers with 'pkg-config'
+function! s:CheckGlade()
+ if executable('pkg-config')
+ if !exists('s:glade_flags')
+ let s:glade_flags = system('pkg-config --cflags libglade-2.0')
+ let s:glade_flags = substitute(s:glade_flags, "\n", '', '')
+ let s:glade_flags = ' ' . s:glade_flags
+ endif
+ return s:glade_flags
+ endif
+ return ''
+endfunction
+
" return a handler dictionary object
function! s:RegHandler(regex, function)
let handler = {}

0 comments on commit 1019556

Please sign in to comment.