From fe5b8989afa1859751acc34d9c0c6f8ccef44f6a Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Thu, 19 Jan 2012 12:59:40 +0000 Subject: [PATCH] less: simplify 1.2 errorformat and split errorformat up * remove some unneeded escaping of spaces and colons from the 1.2 errorformat * split the pre and post 1.2 errorformats up and comment them for future clarity --- syntax_checkers/less.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/syntax_checkers/less.vim b/syntax_checkers/less.vim index acc12ef6..7393b3ef 100644 --- a/syntax_checkers/less.vim +++ b/syntax_checkers/less.vim @@ -25,7 +25,12 @@ endif function! SyntaxCheckers_less_GetLocList() let makeprg = 'lessc '. g:syntastic_less_options .' '. shellescape(expand('%')) . ' /dev/null' - let errorformat = 'ParseError:\ Syntax\ Error\ on\ line\ %[0-9]%#\ in\ %f\:%l\:%c, Syntax %trror on line %l in %f,Syntax %trror on line %l,! Syntax %trror: on line %l: %m,%-G%.%#' + + "lessc >= 1.2 + let errorformat = 'ParseError: Syntax Error on line %[0-9]%# in %f:%l:%c' + "lessc < 1.2 + let errorformat .= ', Syntax %trror on line %l in %f,Syntax %trror on line %l,! Syntax %trror: on line %l: %m,%-G%.%#' + return SyntasticMake({ 'makeprg': makeprg, \ 'errorformat': errorformat, \ 'defaults': {'bufnr': bufnr(""), 'text': "Syntax error"} })