Merge remote-tracking branch 'scrooloose/master'

This commit is contained in:
Chris Hoffman 2011-07-09 02:43:48 -05:00
commit d537ecfdc4
3 changed files with 12 additions and 16 deletions

View File

@ -47,9 +47,6 @@ if !exists("g:syntastic_stl_format")
let g:syntastic_stl_format = '[Syntax: line:%F (%t)]'
endif
"load all the syntax checkers
runtime! syntax_checkers/*.vim
"refresh and redraw all the error info for this buf when saving or reading
autocmd bufreadpost,bufwritepost * call s:UpdateErrors()
function! s:UpdateErrors()
@ -289,6 +286,10 @@ function! SyntasticMake(options)
endfunction
function! s:Checkable(ft)
if !exists("g:loaded_" . a:ft . "_syntax_checker")
exec "runtime syntax_checkers/" . a:ft . ".vim"
endif
return exists("*SyntaxCheckers_". a:ft ."_GetLocList") &&
\ index(g:syntastic_disabled_filetypes, a:ft) == -1
endfunction

View File

@ -20,12 +20,7 @@ if !executable("haml")
endif
function! SyntaxCheckers_haml_GetLocList()
let output = system("haml -c " . shellescape(expand("%")))
if v:shell_error != 0
"haml only outputs the first error, so parse it ourselves
let line = substitute(output, '^\%(Syntax\|Haml\) error on line \(\d*\):.*', '\1', '')
let msg = substitute(output, '^\%(Syntax\|Haml\) error on line \d*:\(.*\)', '\1', '')
return [{'lnum' : line, 'text' : msg, 'bufnr': bufnr(""), 'type': 'E' }]
endif
return []
let makeprg = "haml -c " . shellescape(expand("%"))
let errorformat = 'Haml error on line %l: %m,Syntax error on line %l: %m,%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction

View File

@ -14,15 +14,15 @@ if exists("loaded_haskell_syntax_checker")
endif
let loaded_haskell_syntax_checker = 1
"bail if the user doesnt have ghc installed
if !executable("ghc")
"bail if the user doesnt have ghc-mod installed
if !executable("ghc-mod")
finish
endif
" As this calls ghc, it can take a few seconds... maybe hlint or something
" could do a good enough job?
function! SyntaxCheckers_haskell_GetLocList()
let makeprg = 'ghc '.shellescape(expand('%')).' -e :q'
let makeprg =
\ 'ghc-mod check '. shellescape(expand('%')) .
\ ' && ghc-mod lint ' . shellescape(expand('%'))
let errorformat = '%-G\\s%#,%f:%l:%c:%m,%E%f:%l:%c:,%Z%m,'