make EchoCurrentError() not mask errors with warnings

This commit is contained in:
Martin Grenfell 2011-12-15 23:08:39 +00:00
parent 17f9b764de
commit bfe3725e13

View File

@ -377,13 +377,16 @@ function! s:EchoCurrentError()
endif endif
"If we have an error or warning at the current line, show it "If we have an error or warning at the current line, show it
let lnum = line(".") let errors = s:FilterLocList(b:syntastic_loclist, {'lnum': line("."), "type": 'e'})
for i in b:syntastic_loclist let warnings = s:FilterLocList(b:syntastic_loclist, {'lnum': line("."), "type": 'w'})
if lnum == i['lnum']
let b:syntastic_echoing_error = 1 let b:syntastic_echoing_error = len(errors) || len(warnings)
return s:WideMsg(i['text']) if len(errors)
endif return s:WideMsg(errors[0]['text'])
endfor endif
if len(warnings)
return s:WideMsg(warnings[0]['text'])
endif
"Otherwise, clear the status line "Otherwise, clear the status line
if exists("b:syntastic_echoing_error") if exists("b:syntastic_echoing_error")