misc: adds the option to specify the main nit module to syntastic
authorAlexis Laferrière <alexis.laf@xymus.net>
Mon, 13 Jan 2014 16:39:25 +0000 (11:39 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 14 Jan 2014 00:08:27 +0000 (19:08 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

misc/vim/syntax_checkers/nit/nitc.vim

index 1637f46..563e478 100644 (file)
@@ -37,7 +37,7 @@ function! SyntaxCheckers_nit_nitc_IsAvailable()
 endfunction
 
 function! SyntaxCheckers_nit_nitc_GetLocList()
-       let makeprg = s:nitc . " --no-color --only-metamodel 2>&1 " . shellescape(expand("%"))
+       let makeprg = s:nitc . " --no-color --only-metamodel "
 
        " custom NIT_DIR
        if exists('g:syntastic_nit_dir')
@@ -56,6 +56,16 @@ function! SyntaxCheckers_nit_nitc_GetLocList()
                endfor
        end
 
+       " alternative main module
+       if exists('g:nit_main')
+               let makeprg .= " " . g:nit_main
+       else
+               let makeprg .= " " . shellescape(expand("%"))
+       end
+
+       " pipe stderr
+       let makeprg .= " 2>&1 "
+
        " possible combinations of error messages
        let ef_start = [ '%f:%l\,%c--%*[0-9]:',
                                   \ '%f:%l\,%c--%*[0-9]\,%*[0-9]:',