From 4d957c865846b1f7f7dff62a781da60133c7ac42 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Wed, 11 Jan 2012 16:22:29 +0000 Subject: [PATCH] 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. --- syntax_checkers/sass.vim | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/syntax_checkers/sass.vim b/syntax_checkers/sass.vim index d6147811..23bf345c 100644 --- a/syntax_checkers/sass.vim +++ b/syntax_checkers/sass.vim @@ -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 })