sass: fix a bug with imports

Only cache the imports when the syntax checker is first loaded. Also,
there was a bug in the logic that was causing the imports to be set to
"" on the second run.

Make the imports var script local since we are not allowing users to
change it.
This commit is contained in:
Martin Grenfell 2012-01-11 16:22:29 +00:00
parent 64cb6860fb
commit 4d957c8658

View File

@ -19,17 +19,14 @@ if !executable("sass")
finish
endif
let g:syntastic_sass_imports = 0
"use compass imports if available
let s:imports = ""
if executable("compass")
let s:imports = "--compass"
endif
function! SyntaxCheckers_sass_GetLocList()
"use compass imports if available
if g:syntastic_sass_imports == 0 && executable("compass")
let g:syntastic_sass_imports = "--compass"
else
let g:syntastic_sass_imports = ""
endif
let makeprg='sass '.g:syntastic_sass_imports.' --check '.shellescape(expand('%'))
let makeprg='sass '.s:imports.' --check '.shellescape(expand('%'))
let errorformat = '%ESyntax %trror:%m,%C on line %l of %f,%Z%.%#'
let errorformat .= ',%Wwarning on line %l:,%Z%m,Syntax %trror on line %l: %m'
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })