From ca5cbd85bb3558177b06b9c407d94188c336adf6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Tue, 29 May 2012 14:05:47 -0400 Subject: [PATCH] misc: correctly handles warnings in syntastic Nit syntax checker MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- misc/syntastic/nit.vim | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/misc/syntastic/nit.vim b/misc/syntastic/nit.vim index 5ac60da..b213b1a 100644 --- a/misc/syntastic/nit.vim +++ b/misc/syntastic/nit.vim @@ -20,9 +20,17 @@ endif function! SyntaxCheckers_nit_GetLocList() let makeprg = "nitc --no-color --only-metamodel 2>&1 " . shellescape(expand("%")) - let errorformat = - \'%f:%l\,%c--%*[0-9]: %m, - \%f:%l\,%c--%*[0-9]\,0: %m, - \%f:%l\,%c: %m' + " possible combinations of error messages + let ef_start = [ '%f:%l\,%c--%*[0-9]:', '%f:%l\,%c--%*[0-9]\,%*[0-9]:', '%f:%l\,%c:' ] + let ef_type = [ ' %tarning: ', ' %trror: ', ' Syntax %trror: ' ] + + " generate errorformat from combinations + let errorformat = "" + for s in ef_start + for t in ef_type + let errorformat .= s . t . '%m,' + endfor + endfor + return SyntasticMake({ 'makeprg': makeprg, 'errorformat':errorformat }) endfunction -- 1.7.9.5