misc: update vim syntastic plugin to latest specification
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 5 Mar 2013 16:23:58 +0000 (11:23 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 14 Mar 2013 18:24:16 +0000 (14:24 -0400)
Config moved in a directory and was renamed, as per specification, with
an added bonus of making room for other engines. Also adds new standard
functions.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

misc/vim/syntax_checkers/nit/nitc.vim [moved from misc/vim/syntax_checkers/nit.vim with 86% similarity]

similarity index 86%
rename from misc/vim/syntax_checkers/nit.vim
rename to misc/vim/syntax_checkers/nit/nitc.vim
index 222c080..448c7ae 100644 (file)
 "      g:syntastic_nit_args specifies extra arguments to call nitc
 "      g:syntastic_nit_include_dirs lists directories to include, must be a list
 "============================================================================
-if exists("loaded_nit_syntax_checker")
+if exists("loaded_syntastic_nit_nitc_checker")
        finish
 endif
-let loaded_nit_syntax_checker = 1
+let loaded_syntastic_nit_nitc_checker = 1
 
 " check if nitc is accessible
 if exists('g:syntastic_nitc')
@@ -32,7 +32,11 @@ if !executable(s:nitc)
        finish
 endif
 
-function! SyntaxCheckers_nit_GetLocList()
+function! SyntaxCheckers_nit_nitc_IsAvailable()
+    return executable(expand(s:nitc))
+endfunction
+
+function! SyntaxCheckers_nit_nitc_GetLocList()
        let makeprg = s:nitc . " --no-color --only-metamodel 2>&1 " . shellescape(expand("%"))
 
        " custom NIT_DIR
@@ -66,3 +70,7 @@ function! SyntaxCheckers_nit_GetLocList()
 
        return SyntasticMake({ 'makeprg': makeprg, 'errorformat':errorformat })
 endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+    \ 'filetype': 'nit',
+    \ 'name': 'nitc'})