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.
This commit is contained in:
Martin Grenfell 2011-12-18 00:47:46 +00:00
parent fb0259a4ef
commit 755eddaa06

View File

@ -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()