Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

slim: errorformat includes column if slimrb --version > 1.3.0

  • Loading branch information...
commit d2d8bb926dbb6ddad174f82b63051c0e347e59c7 1 parent 87f10e5
@rbrown rbrown authored
Showing with 16 additions and 1 deletion.
  1. +16 −1 syntax_checkers/slim.vim
View
17 syntax_checkers/slim.vim
@@ -19,8 +19,23 @@ if !executable("slimrb")
finish
endif
+function! s:SlimrbVersion()
+ if !exists('s:slimrb_version')
+ let output = system("slimrb --version 2>/dev/null")
+ let output = substitute(output, '\n$', '', '')
+ let output = substitute(output, '^slim ', '', 'i')
+ let s:slimrb_version = split(output, '\.')
+ end
+ return s:slimrb_version
+endfunction
+
function! SyntaxCheckers_slim_GetLocList()
let makeprg = "slimrb -c " . shellescape(expand("%"))
- let errorformat = '%C\ %#%f\, Line %l,%-G\ %.%#,%ESlim::Parser::SyntaxError: %m,%+C%.%#'
+ if SyntasticIsVersionAtLeast(s:SlimrbVersion(), [1,3,1])
+ let errorformat = '%C\ %#%f\, Line %l\, Column %c,%-G\ %.%#,%ESlim::Parser::SyntaxError: %m,%+C%.%#'
+ else
+ let errorformat = '%C\ %#%f\, Line %l,%-G\ %.%#,%ESlim::Parser::SyntaxError: %m,%+C%.%#'
+ endif
+ echo errorformat
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction
Please sign in to comment.
Something went wrong with that request. Please try again.