@window_cached
def syntastic(pl, err_format=u'ERR: \ue0a1 {first_line} ({num}) ', warn_format=u'WARN: \ue0a1 {first_line} ({num}) '):
 if (not vim_global_exists(u'SyntasticLoclist')):
  return None
 has_errors = int(vim.eval(u'g:SyntasticLoclist.current().hasErrorsOrWarningsToDisplay()'))
 if (not has_errors):
  return
 errors = vim.eval(u'g:SyntasticLoclist.current().errors()')
 warnings = vim.eval(u'g:SyntasticLoclist.current().warnings()')
 segments = []
 if errors:
  segments.append({u'contents': err_format.format(first_line=errors[0][u'lnum'], num=len(errors)), u'highlight_groups': [u'syntastic:error', u'error']})
 if warnings:
  segments.append({u'contents': warn_format.format(first_line=warnings[0][u'lnum'], num=len(warnings)), u'highlight_groups': [u'syntastic:warning', u'warning']})
 return segments

@ window_cached def syntastic ( pl , err_format = u'ERR: \ue0a1 {first_line} ({num}) ' , warn_format = u'WARN: \ue0a1 {first_line} ({num}) ' ) : if ( not vim_global_exists ( u'SyntasticLoclist' ) ) : return None has_errors = int ( vim . eval ( u'g:SyntasticLoclist.current().hasErrorsOrWarningsToDisplay()' ) ) if ( not has_errors ) : return errors = vim . eval ( u'g:SyntasticLoclist.current().errors()' ) warnings = vim . eval ( u'g:SyntasticLoclist.current().warnings()' ) segments = [ ] if errors : segments . append ( { u'contents' : err_format . format ( first_line = errors [ 0 ] [ u'lnum' ] , num = len ( errors ) ) , u'highlight_groups' : [ u'syntastic:error' , u'error' ] } ) if warnings : segments . append ( { u'contents' : warn_format . format ( first_line = warnings [ 0 ] [ u'lnum' ] , num = len ( warnings ) ) , u'highlight_groups' : [ u'syntastic:warning' , u'warning' ] } ) return segments
show whether syntastic has found any errors or warnings .