From 4cc6d8b4ceb55bcfcdd7da163cb6d526c87bc126 Mon Sep 17 00:00:00 2001 From: Brendan Erwin Date: Wed, 18 Jul 2012 20:45:34 -0400 Subject: [PATCH] Improved the behavior per suggestions --- syntax_checkers/coffee.vim | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/syntax_checkers/coffee.vim b/syntax_checkers/coffee.vim index 679d9857..e0297ae9 100644 --- a/syntax_checkers/coffee.vim +++ b/syntax_checkers/coffee.vim @@ -25,17 +25,23 @@ function! SyntaxCheckers_coffee_GetLocList() let errorformat = 'Syntax%trror: In %f\, %m on line %l,%EError: In %f\, Parse error on line %l: %m,%EError: In %f\, %m on line %l,%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G%.%#' let coffee_results = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + + if !empty(coffee_results) + return coffee_results + endif + - let lint_results = [] if executable("coffeelint") let lint_options = '' if(exists('g:coffee_lint_options')) let lint_options = g:coffee_lint_options endif + let coffeelint = 'coffeelint --csv '.lint_options.' '.shellescape(expand('%')) - echo coffeelint - let lint_results = SyntasticMake({ 'makeprg': coffeelint, 'errorformat': '%f\,%l\,error\,%m' }) + let lint_results = SyntasticMake({ 'makeprg': coffeelint, 'errorformat': '%f\,%l\,%trror\,%m', 'subtype': 'Style' }) + + return lint_results endif - return coffee_results + lint_results + return [] endfunction