Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Only keep "valid" entries in the error count. #217

wants to merge 1 commit into from

2 participants


The location list returned by getloclist() may contain entries that are not errorformat matches. By "definition", (see :help getqflist), matched lines have the attribute "valid": 1 set, so only keep those lines in error/warning list to avoid erroneous counts and strange behaviors.

Signed-off-by: Florent Bruneau

@Fruneau Fruneau Only keep "valid" entries in the error count.
Signed-off-by: Florent Bruneau <>

This seems like a reasonable idea since most (if not all) errorformats have something like %-G%.%# to filter out all misc messages from the syntax checker.

It would be better to filter out "invalid" errors at the end of the CacheErrors() function so that they never get into the system in the first place. I suspect that doing the filter in the Warnings() and Errors() methods will require some extra bug fixing since there are several calls directly to Loclist() in the code.

FYI: When submitting pull requests its usually a good idea to stick your commits in a separate branch in your repo. That way, if they get rejected, or changes are requested, you can just delete the branch and push a new one.


Well, indeed, I though github was clever enough to take into account the fact master~ is a dynamic reference... I'll reopen the request with a real branch.

@Fruneau Fruneau closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 26, 2012
  1. @Fruneau

    Only keep "valid" entries in the error count.

    Fruneau authored
    Signed-off-by: Florent Bruneau <>
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 plugin/syntastic.vim
4 plugin/syntastic.vim
@@ -229,14 +229,14 @@ endfunction
function! s:Errors()
if !exists("b:syntastic_errors")
- let b:syntastic_errors = s:FilterLocList({'type': "E"})
+ let b:syntastic_errors = s:FilterLocList({'type': "E", 'valid': 1})
return b:syntastic_errors
function! s:Warnings()
if !exists("b:syntastic_warnings")
- let b:syntastic_warnings = s:FilterLocList({'type': "W"})
+ let b:syntastic_warnings = s:FilterLocList({'type': "W", 'valid': 1})
return b:syntastic_warnings
Something went wrong with that request. Please try again.