Bram,

Various of Vim's builtin functions suppress displaying error messages
(by default) and instead indicate an error via a specific return.  A
simple example is expand(), which returns an empty string when the
expansion fails.

If any of these functions are evaluated as part of 'statusline' and
"error", the statusline is disabled even though there is no error
message indicating to the user why it got disabled.

  " Set the following and then move the cursor to a blank line
  :set statusline=%{expand('<cword>')}

The attached patch moves the check for "suppressing error messages" to
the top of emsg().  This provides the more intuitive behavior of only
flagging an error when a message was actually displayed to the user.

Thanks,
-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[email protected]>
diff --git a/src/message.c b/src/message.c
--- a/src/message.c
+++ b/src/message.c
@@ -569,6 +569,10 @@
     int		severe;
 #endif
 
+    /* Skip this if not giving error messages at the moment. */
+    if (emsg_not_now())
+	return TRUE;
+
     called_emsg = TRUE;
     ex_exitval = 1;
 
@@ -581,10 +585,6 @@
     emsg_severe = FALSE;
 #endif
 
-    /* Skip this if not giving error messages at the moment. */
-    if (emsg_not_now())
-	return TRUE;
-
     if (!emsg_off || vim_strchr(p_debug, 't') != NULL)
     {
 #ifdef FEAT_EVAL

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui