From 999d3c1bb3b00129b8c1fbeae05c5579c98d3542 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Mon, 26 Mar 2012 22:43:56 +0200 Subject: [PATCH] Only keep "valid" entries in the error count. 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 --- plugin/syntastic.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index e2c56c9d..1084aa75 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -185,6 +185,8 @@ function! s:CacheErrors() for ft in split(fts, '\.') if s:Checkable(ft) let errors = SyntaxCheckers_{ft}_GetLocList() + "keep only lines that effectively match an error/warning + let errors = s:FilterLocList({'valid': 1}, errors) "make errors have type "E" by default call SyntasticAddToErrors(errors, {'type': 'E'}) call extend(s:LocList(), errors)