From e24bd80f4434f350e512985045ab8353fbcb8056 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sun, 11 Dec 2011 09:26:55 +0000 Subject: [PATCH] fix a strange bug when echoing error messages In the javascript:jshint checker the error messages are being returned with a newline prefixed to the front. I have tried to fix this in the errorformat - but I cant see anything that would cause it. Im not sure if this is a one-off thing, but strip out all new lines here just in case. --- plugin/syntastic.vim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index bf7a951c..ff6bd8a4 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -313,9 +313,18 @@ function! s:WideMsg(msg) let old_ruler = &ruler let old_showcmd = &showcmd + let msg = strpart(a:msg, 0, winwidth(0)-1) + + "This is here because it is possible for some error messages to begin with + "\n which will cause a "press enter" prompt. I have noticed this in the + "javascript:jshint checker and have been unable to figure out why it + "happens + let msg = substitute(msg, "\n", "", "g") + set noruler noshowcmd redraw - echo strpart(a:msg, 0, winwidth(0)-1) + + echo msg let &ruler=old_ruler let &showcmd=old_showcmd