updated for version 7.0203
diff --git a/src/buffer.c b/src/buffer.c
index 9af8d50..12ee1b3 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2947,15 +2947,12 @@
     {
 	p = msg_trunc_attr(buffer, FALSE, 0);
 	if (restart_edit != 0 || (msg_scrolled && !need_wait_return))
-	{
 	    /* Need to repeat the message after redrawing when:
 	     * - When restart_edit is set (otherwise there will be a delay
 	     *   before redrawing).
 	     * - When the screen was scrolled but there is no wait-return
 	     *   prompt. */
-	    set_keep_msg(p);
-	    keep_msg_attr = 0;
-	}
+	    set_keep_msg(p, 0);
     }
 
     vim_free(buffer);
@@ -3271,6 +3268,20 @@
     char_u	opt;
 #define TMPLEN 70
     char_u	tmp[TMPLEN];
+    char_u	*usefmt = fmt;
+
+#ifdef FEAT_EVAL
+    /*
+     * When the format starts with "%!" then evaluate it as an expression and
+     * use the result as the actual format string.
+     */
+    if (fmt[0] == '%' && fmt[1] == '!')
+    {
+	usefmt = eval_to_string_safe(fmt + 2, NULL, use_sandbox);
+	if (usefmt == NULL)
+	    usefmt = (char_u *)"";
+    }
+#endif
 
     if (fillchar == 0)
 	fillchar = ' ';
@@ -3286,7 +3297,7 @@
     curitem = 0;
     prevchar_isflag = TRUE;
     prevchar_isitem = FALSE;
-    for (s = fmt; *s;)
+    for (s = usefmt; *s; )
     {
 	if (*s != NUL && *s != '%')
 	    prevchar_isflag = prevchar_isitem = FALSE;
@@ -3432,7 +3443,7 @@
 	    if (minwid < 0)	/* overflow */
 		minwid = 0;
 	}
-	if (*s == STL_HIGHLIGHT)
+	if (*s == STL_USER_HL)
 	{
 	    item[curitem].type = Highlight;
 	    item[curitem].start = p;
@@ -3698,6 +3709,20 @@
 		case 7: str = (char_u *)",+-"; break;
 	    }
 	    break;
+
+	case STL_HIGHLIGHT:
+	    t = s;
+	    while (*s != '#' && *s != NUL)
+		++s;
+	    if (*s == '#')
+	    {
+		item[curitem].type = Highlight;
+		item[curitem].start = p;
+		item[curitem].minwid = -syn_namen2id(t, s - t);
+		curitem++;
+	    }
+	    ++s;
+	    continue;
 	}
 
 	item[curitem].start = p;
@@ -3814,6 +3839,11 @@
     *p = NUL;
     itemcnt = curitem;
 
+#ifdef FEAT_EVAL
+    if (usefmt != fmt)
+	vim_free(usefmt);
+#endif
+
     width = vim_strsize(out);
     if (maxwidth > 0 && width > maxwidth)
     {
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 1eefcd8..5798250 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -7029,7 +7029,7 @@
 	out_flush();	    /* output one line at a time */
 	ui_breakcheck();
 
-	if (tp->tp_topframe == topframe)
+	if (tp  == curtab)
 	    wp = firstwin;
 	else
 	    wp = tp->tp_firstwin;
diff --git a/src/message.c b/src/message.c
index 1cea013..5521a15 100644
--- a/src/message.c
+++ b/src/message.c
@@ -180,10 +180,7 @@
 
     if (keep && retval && vim_strsize(s) < (int)(Rows - cmdline_row - 1)
 							   * Columns + sc_col)
-    {
-	set_keep_msg(s);
-	keep_msg_attr = 0;
-    }
+	set_keep_msg(s, 0);
 
     vim_free(buf);
     --entered;
@@ -1077,8 +1074,9 @@
  * Set "keep_msg" to "s".  Free the old value and check for NULL pointer.
  */
     void
-set_keep_msg(s)
+set_keep_msg(s, attr)
     char_u	*s;
+    int		attr;
 {
     vim_free(keep_msg);
     if (s != NULL && msg_silent == 0)
@@ -1086,8 +1084,23 @@
     else
 	keep_msg = NULL;
     keep_msg_more = FALSE;
+    keep_msg_attr = attr;
 }
 
+#if defined(FEAT_TERMRESPONSE) || defined(PROTO)
+/*
+ * If there currently is a message being displayed, set "keep_msg" to it, so
+ * that it will be displayed again after redraw.
+ */
+    void
+set_keep_msg_from_hist()
+{
+    if (keep_msg == NULL && last_msg_hist != NULL && msg_scrolled == 0
+							  && (State & NORMAL))
+	set_keep_msg(last_msg_hist->msg, last_msg_hist->attr);
+}
+#endif
+
 /*
  * Prepare for outputting characters in the command line.
  */
@@ -3161,7 +3174,7 @@
     else
 	keep_msg_attr = 0;
     if (msg_attr(message, keep_msg_attr) && msg_scrolled == 0)
-	set_keep_msg(message);
+	set_keep_msg(message, keep_msg_attr);
     msg_didout = FALSE;	    /* overwrite this message */
     msg_nowait = TRUE;	    /* don't wait for this message */
     msg_col = 0;
diff --git a/src/netbeans.c b/src/netbeans.c
index d183e49..eb9146b 100644
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -3442,8 +3442,7 @@
 	     *   before redrawing).
 	     * - When the screen was scrolled but there is no wait-return
 	     *   prompt. */
-	    set_keep_msg(p);
-	    keep_msg_attr = 0;
+	    set_keep_msg(p, 0);
 	}
 	msg_scrolled_ign = FALSE;
 	/* add_to_input_buf((char_u *)"\f", 1); */