From 755eddaa06e1fde98d62d793768ae383bcddd25d Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sun, 18 Dec 2011 00:47:46 +0000 Subject: [PATCH] make all loclist items errors by default If a syntax checker returns items with blank 'type' keys, then make them errors. This simplifies things since we were previously making the assumption that empty types are errors anyway. It also fixes a bug in EchoCurrentError() function that was due to not checking for a blank ty pe. --- plugin/syntastic.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 5869004e..36079401 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -163,7 +163,10 @@ function! s:CacheErrors() "functions legally for filetypes like "gentoo-metadata" let ft = substitute(&ft, '-', '_', 'g') if s:Checkable(ft) - call extend(s:LocList(), SyntaxCheckers_{ft}_GetLocList()) + let errors = SyntaxCheckers_{ft}_GetLocList() + "make errors have type "E" by default + call SyntasticAddToErrors(errors, {'type': 'E'}) + call extend(s:LocList(), errors) endif endif endfunction @@ -211,7 +214,7 @@ function! s:ErrorsForType(type) endfunction function! s:Errors() - return extend(s:ErrorsForType("E"), s:ErrorsForType('')) + return extend(s:ErrorsForType("E")) endfunction function! s:Warnings()