diff --git a/autoload/syntastic/preprocess.vim b/autoload/syntastic/preprocess.vim index 68002951..339150ed 100644 --- a/autoload/syntastic/preprocess.vim +++ b/autoload/syntastic/preprocess.vim @@ -68,10 +68,15 @@ function! syntastic#preprocess#flow(errors) abort " {{{2 let false = 0 let null = '' + let idx = 0 + while idx < len(a:errors) && a:errors[idx][0] != '{' + let idx += 1 + endwhile + " A hat tip to Marc Weber for this trick " http://stackoverflow.com/questions/17751186/iterating-over-a-string-in-vimscript-or-parse-a-json-file/19105763#19105763 try - let errs = eval(join(a:errors, '')) + let errs = eval(join(a:errors[idx :], '')) catch let errs = {} endtry diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 324a7721..dda6ec82 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:_SYNTASTIC_START endif -let g:_SYNTASTIC_VERSION = '3.6.0-84' +let g:_SYNTASTIC_VERSION = '3.6.0-85' lockvar g:_SYNTASTIC_VERSION " Sanity checks {{{1 diff --git a/syntax_checkers/javascript/flow.vim b/syntax_checkers/javascript/flow.vim index 077a917e..5db9f864 100644 --- a/syntax_checkers/javascript/flow.vim +++ b/syntax_checkers/javascript/flow.vim @@ -21,13 +21,20 @@ endif let s:save_cpo = &cpo set cpo&vim +function! SyntaxCheckers_javascript_flow_IsAvailable() dict + if !executable(self.getExec()) + return 0 + endif + return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 6]) +endfunction + function! SyntaxCheckers_javascript_flow_GetLocList() dict if findfile('.flowconfig', '.;') ==# '' return [] endif let makeprg = self.makeprgBuild({ - \ 'exe': self.getExecEscaped() . ' check', + \ 'exe': self.getExecEscaped() . ' status', \ 'args_after': '--show-all-errors --json' }) let errorformat =