2009-07-11 03:09:20 -04:00
|
|
|
"============================================================================
|
|
|
|
"File: sass.vim
|
|
|
|
"Description: Syntax checking plugin for syntastic.vim
|
2009-12-16 05:02:36 -05:00
|
|
|
"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
|
2009-07-11 03:09:20 -04:00
|
|
|
"License: This program is free software. It comes without any warranty,
|
|
|
|
" to the extent permitted by applicable law. You can redistribute
|
|
|
|
" it and/or modify it under the terms of the Do What The Fuck You
|
|
|
|
" Want To Public License, Version 2, as published by Sam Hocevar.
|
|
|
|
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
|
|
|
"
|
|
|
|
"============================================================================
|
|
|
|
if exists("loaded_sass_syntax_checker")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let loaded_sass_syntax_checker = 1
|
|
|
|
|
|
|
|
"bail if the user doesnt have the sass binary installed
|
|
|
|
if !executable("sass")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
2012-09-24 09:41:30 -04:00
|
|
|
"By default do not check partials as unknown variables are a syntax error
|
|
|
|
if !exists("g:syntastic_sass_check_partials")
|
|
|
|
let g:syntastic_sass_check_partials = 0
|
|
|
|
endif
|
|
|
|
|
2012-01-11 11:22:29 -05:00
|
|
|
"use compass imports if available
|
|
|
|
let s:imports = ""
|
|
|
|
if executable("compass")
|
|
|
|
let s:imports = "--compass"
|
|
|
|
endif
|
2011-01-31 02:57:54 -05:00
|
|
|
|
2009-07-13 07:12:18 -04:00
|
|
|
function! SyntaxCheckers_sass_GetLocList()
|
2012-09-24 09:41:30 -04:00
|
|
|
if !g:syntastic_sass_check_partials && expand('%:t')[0] == '_'
|
|
|
|
return []
|
|
|
|
end
|
2012-05-25 10:10:13 -04:00
|
|
|
let makeprg='sass --no-cache '.s:imports.' --check '.shellescape(expand('%'))
|
2011-11-29 04:16:40 -05:00
|
|
|
let errorformat = '%ESyntax %trror:%m,%C on line %l of %f,%Z%.%#'
|
2011-01-31 02:57:54 -05:00
|
|
|
let errorformat .= ',%Wwarning on line %l:,%Z%m,Syntax %trror on line %l: %m'
|
2010-05-10 00:10:22 -04:00
|
|
|
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
|
|
|
|
|
|
|
return loclist
|
2009-07-11 03:09:20 -04:00
|
|
|
endfunction
|