From: Alexis Laferrière Date: Tue, 5 Mar 2013 16:23:58 +0000 (-0500) Subject: misc: update vim syntastic plugin to latest specification X-Git-Tag: v0.6~82^2 X-Git-Url: http://nitlanguage.org misc: update vim syntastic plugin to latest specification 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 --- diff --git a/misc/vim/syntax_checkers/nit.vim b/misc/vim/syntax_checkers/nit/nitc.vim similarity index 86% rename from misc/vim/syntax_checkers/nit.vim rename to misc/vim/syntax_checkers/nit/nitc.vim index 222c080..448c7ae 100644 --- a/misc/vim/syntax_checkers/nit.vim +++ b/misc/vim/syntax_checkers/nit/nitc.vim @@ -13,10 +13,10 @@ " 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'})