Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

c syntax_checker: add support for glade

  • Loading branch information...
commit 101955648e448c1b1d57e2d2c47aeb6a44655733 1 parent bd93029
@kongo2002 kongo2002 authored scrooloose committed
Showing with 14 additions and 0 deletions.
  1. +14 −0 syntax_checkers/c.vim
View
14 syntax_checkers/c.vim
@@ -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 = {}
Please sign in to comment.
Something went wrong with that request. Please try again.