From bfe3725e13564a13c39c9b85a366994c932d7460 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Thu, 15 Dec 2011 23:08:39 +0000 Subject: [PATCH] make EchoCurrentError() not mask errors with warnings --- plugin/syntastic.vim | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 4e61230f..a2eb39ec 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -377,13 +377,16 @@ function! s:EchoCurrentError() endif "If we have an error or warning at the current line, show it - let lnum = line(".") - for i in b:syntastic_loclist - if lnum == i['lnum'] - let b:syntastic_echoing_error = 1 - return s:WideMsg(i['text']) - endif - endfor + let errors = s:FilterLocList(b:syntastic_loclist, {'lnum': line("."), "type": 'e'}) + let warnings = s:FilterLocList(b:syntastic_loclist, {'lnum': line("."), "type": 'w'}) + + let b:syntastic_echoing_error = len(errors) || len(warnings) + if len(errors) + return s:WideMsg(errors[0]['text']) + endif + if len(warnings) + return s:WideMsg(warnings[0]['text']) + endif "Otherwise, clear the status line if exists("b:syntastic_echoing_error")