changeset 680:5b101ff9d4c4 v7.0203

updated for version 7.0203
author vimboss
date Tue, 21 Feb 2006 22:12:05 +0000
parents e629de7618da
children 9364d114ed8d
files runtime/doc/options.txt runtime/doc/tags runtime/doc/todo.txt runtime/doc/version7.txt runtime/syntax/mgl.vim src/eval.c src/ex_cmds.c src/globals.h src/gui_beval.c src/main.c src/memline.c src/misc1.c src/misc2.c src/option.c src/option.h src/screen.c src/structs.h src/term.c src/version.h
diffstat 19 files changed, 349 insertions(+), 135 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*	For Vim version 7.0aa.  Last change: 2006 Feb 20
+*options.txt*	For Vim version 7.0aa.  Last change: 2006 Feb 21
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -6002,6 +6002,14 @@ A jump table for the options with a shor
 	All fields except the {item} is optional.  A single percent sign can
 	be given as "%%".  Up to 80 items can be specified.
 
+	When the option starts with "%!" then it is used as an expression,
+	evaluated and the result is used as the option value.  Example: >
+		:set statusline=%!MyStatusLine()
+<	The result can contain %{} items that will be evaluated too.
+
+	When there is error while evaluating the option then it will be made
+	empty to avoid further errors.  Otherwise screen updating would loop.
+
 	Note that the only effect of 'ruler' when this option is set (and
 	'laststatus' is 2) is controlling the output of |CTRL-G|.
 
@@ -6060,7 +6068,7 @@ A jump table for the options with a shor
 	      percentage described for 'ruler'.  Always 3 in length.
 	a S   Argument list status as in default title.  ({current} of {max})
 	      Empty if the argument file count is zero or one.
-	{ NF  Evaluate expression between '{' and '}' and substitute result.
+	{ NF  Evaluate expression between '%{' and '}' and substitute result.
 	      Note that there is no '%' before the closing '}'.
 	( -   Start of item group.  Can be used for setting the width and
 	      alignment of a section.  Must be followed by %) somewhere.
@@ -6069,6 +6077,10 @@ A jump table for the options with a shor
 	      No width fields allowed.
 	= -   Separation point between left and right aligned items.
 	      No width fields allowed.
+	# -   Set highlight group.  The name must follow and then a # again.
+	      Thus use %#HLname# for highlight group HLname.  The same
+	      highlighting is used, also for the statusline of non-current
+	      windows.
 	* -   Set highlight group to User{N}, where {N} is taken from the
 	      minwid field, e.g. %1*.  Restore normal highlight with %* or %0*.
 	      The difference between User{N} and StatusLine  will be applied
@@ -6264,7 +6276,7 @@ A jump table for the options with a shor
 
 	The value is evaluated like with 'statusline'.  You can use
 	|tabpagenr()|, |tabpagewinnr()| and |tabpagebuflist()| to figure out
-	the text to be displayed.
+	the text to be displayed.  See |setting-tabline| for more info.
 
 	Keep in mind that only one of the tab pages is the current one, others
 	are invisible and you can't jump to their windows.
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -6582,6 +6582,7 @@ setloclist()	eval.txt	/*setloclist()*
 setqflist()	eval.txt	/*setqflist()*
 setreg()	eval.txt	/*setreg()*
 setting-guifont	gui.txt	/*setting-guifont*
+setting-tabline	tabpage.txt	/*setting-tabline*
 setwinvar()	eval.txt	/*setwinvar()*
 sftp	pi_netrw.txt	/*sftp*
 sgml.vim	syntax.txt	/*sgml.vim*
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.0aa.  Last change: 2006 Feb 20
+*todo.txt*      For Vim version 7.0aa.  Last change: 2006 Feb 21
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -30,7 +30,10 @@ be worked on, but only if you sponsor Vi
 							*known-bugs*
 -------------------- Known bugs and current work -----------------------
 
-'tabline' documentation with an example; esp for the highlighting
+Remove resetting "bold" from screen_start_highlight()?
+
+Using 'tabline' breaks using mouse to select a tab.  How to do that?
+See suggestion from Tony Mechelynck.
 
 P_INSECURE should be remembered for local option values separately.
 
@@ -63,6 +66,7 @@ Open new tab by double click in tab line
     ":tab!" to open it at the end, ":0tab" to open at the start.
     ":tab split" opens tab with window same as current window.
     ":tpsplit" would split the tab with all its windows.
+In GUI: right click can popup menu to close a specific tab.
 Option to put tab line at the left or right?  Need an option to specify its
 witdh.  It's like a separate window with ":tabs" output.
     :tabdo    ":tabdo windo cmd" should also work
@@ -85,6 +89,8 @@ windows.  Let's call them "tab pages".
 
 Crash with X command server (Ciaran McCreesh).
 
+"dip" in end empty lines at end of file leaves one line. (Matt Mzyzik)
+
 Ctags still hasn't included the patch.  Darren is looking for someone to do
 maintanance.
 
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,4 +1,4 @@
-*version7.txt*  For Vim version 7.0aa.  Last change: 2006 Feb 18
+*version7.txt*  For Vim version 7.0aa.  Last change: 2006 Feb 21
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -654,6 +654,8 @@ New Keymaps: ~
 
 Sinhala (Sri Lanka) (Harshula Jayasuriya)
 
+Tamil in TSCII encoding (Yegappan Lakshmanan)
+
 
 New message translations: ~
 
@@ -1016,6 +1018,12 @@ Insert mode completion for whole lines n
 The colortest.vim script can now be invoked directly with ":source" or
 ":runtime".
 
+The 'statusline' option and other options that support the same format can now
+use these new features:
+- When it starts with "%!" the value is first evaluated as an expression
+  before parsing the value.
+- "%#HLname#" can be used to start highlighting with HLname.
+
 ==============================================================================
 COMPILE TIME CHANGES					*compile-changes-7*
 
@@ -1710,4 +1718,8 @@ be written without write permission. (Ju
 Motif: In diff mode dragging one scrollbar didn't update the scrollbar of the
 other diff'ed window.
 
+When editing in an xterm with a different number of colors than expected the
+screen would be cleared and redrawn, causing the message about the edited file
+to be cleared.  Now set "keep_msg" to redraw the last message.
+
  vim:tw=78:ts=8:ft=help:norl:
new file mode 100644
--- /dev/null
+++ b/runtime/syntax/mgl.vim
@@ -0,0 +1,128 @@
+" Vim syntax file
+" Language:	MGL
+" Version: 1.0
+" Last Change:	2006 Feb 21
+" Maintainer:  Gero Kuhlmann <gero@gkminix.han.de>
+"
+" $Id$
+"
+if version < 600
+  syntax clear
+elseif exists("b:current_syntax")
+  finish
+endif
+
+
+syn sync lines=250
+
+syn keyword mglBoolean		true false
+syn keyword mglConditional	if else then
+syn keyword mglConstant		nil
+syn keyword mglPredefined	maxint
+syn keyword mglLabel		case goto label
+syn keyword mglOperator		to downto in of with
+syn keyword mglOperator		and not or xor div mod
+syn keyword mglRepeat		do for repeat while to until
+syn keyword mglStatement	procedure function break continue return restart
+syn keyword mglStatement	program begin end const var type
+syn keyword mglStruct		record
+syn keyword mglType		integer string char boolean char ipaddr array
+
+
+" String
+if !exists("mgl_one_line_string")
+  syn region  mglString matchgroup=mglString start=+'+ end=+'+ contains=mglStringEscape
+  syn region  mglString matchgroup=mglString start=+"+ end=+"+ contains=mglStringEscapeGPC
+else
+  "wrong strings
+  syn region  mglStringError matchgroup=mglStringError start=+'+ end=+'+ end=+$+ contains=mglStringEscape
+  syn region  mglStringError matchgroup=mglStringError start=+"+ end=+"+ end=+$+ contains=mglStringEscapeGPC
+  "right strings
+  syn region  mglString matchgroup=mglString start=+'+ end=+'+ oneline contains=mglStringEscape
+  syn region  mglString matchgroup=mglString start=+"+ end=+"+ oneline contains=mglStringEscapeGPC
+end
+syn match   mglStringEscape	contained "''"
+syn match   mglStringEscapeGPC	contained '""'
+
+
+if exists("mgl_symbol_operator")
+  syn match   mglSymbolOperator		"[+\-/*=\%]"
+  syn match   mglSymbolOperator		"[<>]=\="
+  syn match   mglSymbolOperator		"<>"
+  syn match   mglSymbolOperator		":="
+  syn match   mglSymbolOperator		"[()]"
+  syn match   mglSymbolOperator		"\.\."
+  syn match   mglMatrixDelimiter	"(."
+  syn match   mglMatrixDelimiter	".)"
+  syn match   mglMatrixDelimiter	"[][]"
+endif
+
+syn match  mglNumber	"-\=\<\d\+\>"
+syn match  mglHexNumber	"\$[0-9a-fA-F]\+\>"
+syn match  mglCharacter	"\#[0-9]\+\>"
+syn match  mglIpAddr	"[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\>"
+
+syn region mglComment	start="(\*"  end="\*)"
+syn region mglComment	start="{"  end="}"
+syn region mglComment	start="//"  end="$"
+
+if !exists("mgl_no_functions")
+  syn keyword mglFunction	dispose new
+  syn keyword mglFunction	get load print select
+  syn keyword mglFunction	odd pred succ
+  syn keyword mglFunction	chr ord abs sqr
+  syn keyword mglFunction	exit
+  syn keyword mglOperator	at timeout
+endif
+
+
+syn region mglPreProc	start="(\*\$"  end="\*)"
+syn region mglPreProc	start="{\$"  end="}"
+
+syn keyword mglException	try except raise
+syn keyword mglPredefined	exception
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_mgl_syn_inits")
+  if version < 508
+    let did_mgl_syn_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+
+  HiLink mglBoolean		Boolean
+  HiLink mglComment		Comment
+  HiLink mglConditional		Conditional
+  HiLink mglConstant		Constant
+  HiLink mglException		Exception
+  HiLink mglFunction		Function
+  HiLink mglLabel		Label
+  HiLink mglMatrixDelimiter	Identifier
+  HiLink mglNumber		Number
+  HiLink mglHexNumber		Number
+  HiLink mglCharacter		Number
+  HiLink mglIpAddr		Number
+  HiLink mglOperator		Operator
+  HiLink mglPredefined		mglFunction
+  HiLink mglPreProc		PreProc
+  HiLink mglRepeat		Repeat
+  HiLink mglStatement		Statement
+  HiLink mglString		String
+  HiLink mglStringEscape	Special
+  HiLink mglStringEscapeGPC	Special
+  HiLink mglStringError		Error
+  HiLink mglStruct		mglStatement
+  HiLink mglSymbolOperator	mglOperator
+  HiLink mglType		Type
+
+  delcommand HiLink
+endif
+
+
+let b:current_syntax = "mgl"
+
+" vim: ts=8 sw=2
--- a/src/eval.c
+++ b/src/eval.c
@@ -14895,7 +14895,7 @@ f_tabpagebuflist(argvars, rettv)
     {
 	tp = find_tabpage((int)get_tv_number(&argvars[0]));
 	if (tp != NULL)
-	    wp = tp->tp_firstwin;
+	    wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
     }
     if (wp == NULL)
 	rettv->vval.v_number = 0;
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1212,11 +1212,8 @@ do_filter(line1, line2, eap, cmd, do_in,
 		vim_snprintf((char *)msg_buf, sizeof(msg_buf),
 				    _("%ld lines filtered"), (long)linecount);
 		if (msg(msg_buf) && !msg_scroll)
-		{
 		    /* save message to display it after redraw */
-		    set_keep_msg(msg_buf);
-		    keep_msg_attr = 0;
-		}
+		    set_keep_msg(msg_buf, 0);
 	    }
 	    else
 		msgmore((long)linecount);
@@ -4910,11 +4907,8 @@ do_sub_msg(count_only)
 	    vim_snprintf((char *)msg_buf + len, sizeof(msg_buf) - len,
 		    _(" on %ld lines"), (long)sub_nlines);
 	if (msg(msg_buf))
-	{
 	    /* save message to display it after redraw */
-	    set_keep_msg(msg_buf);
-	    keep_msg_attr = 0;
-	}
+	    set_keep_msg(msg_buf, 0);
 	return TRUE;
     }
     if (got_int)
--- a/src/globals.h
+++ b/src/globals.h
@@ -488,7 +488,7 @@ EXTERN win_T	*prevwin INIT(= NULL);	/* p
 # define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next)
 #define FOR_ALL_TAB_WINDOWS(tp, wp) \
     for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \
-	for ((wp) = ((tp)->tp_topframe == topframe) \
+	for ((wp) = ((tp) == curtab) \
 		? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
 #else
 # define firstwin curwin
@@ -1446,7 +1446,10 @@ EXTERN char_u e_invexprmsg[]	INIT(= N_("
 EXTERN char_u e_guarded[]	INIT(= N_("E463: Region is guarded, cannot modify"));
 EXTERN char_u e_nbreadonly[]	INIT(= N_("E744: NetBeans does not allow changes in read-only files"));
 #endif
+#if defined(FEAT_INS_EXPAND) || defined(FEAT_EVAL) || defined(FEAT_SYN_HL) \
+	|| defined(FEAT_WINDOWS)
 EXTERN char_u e_intern2[]	INIT(= N_("E685: Internal error: %s"));
+#endif
 EXTERN char_u e_maxmempat[]	INIT(= N_("E363: pattern uses more memory than 'maxmempattern'"));
 EXTERN char_u e_emptybuf[]	INIT(= N_("E749: empty buffer"));
 
--- a/src/gui_beval.c
+++ b/src/gui_beval.c
@@ -103,7 +103,11 @@ general_beval_cb(beval, state)
 # else
    /* Assume Athena */
 #  include <X11/Shell.h>
-#  include <X11/Xaw/Label.h>
+#  ifdef FEAT_GUI_NEXTAW
+#   include <X11/neXtaw/Label.h>
+#  else
+#   include <X11/Xaw/Label.h>
+#  endif
 # endif
 #endif
 
--- a/src/main.c
+++ b/src/main.c
@@ -1059,6 +1059,7 @@ main_loop(cmdwin, noexmode)
 		/* msg_attr_keep() will set keep_msg to NULL, must free the
 		 * string here. */
 		p = keep_msg;
+		keep_msg = NULL;
 		msg_attr(p, keep_msg_attr);
 		vim_free(p);
 	    }
@@ -1169,7 +1170,7 @@ getout(exitval)
     for (tp = first_tabpage; tp != NULL; tp = next_tp)
     {
 	next_tp = tp->tp_next;
-	for (wp = (tp->tp_topframe == topframe)
+	for (wp = (tp == curtab)
 		    ? firstwin : tp->tp_firstwin; wp != NULL; wp = wp->w_next)
 	{
 	    buf = wp->w_buffer;
--- a/src/memline.c
+++ b/src/memline.c
@@ -2740,10 +2740,8 @@ ml_delete_int(buf, lnum, message)
 		&& !netbeansSuppressNoLines
 #endif
 	   )
-	{
-	    set_keep_msg((char_u *)_(no_lines_msg));
-	    keep_msg_attr = 0;
-	}
+	    set_keep_msg((char_u *)_(no_lines_msg), 0);
+
 	/* FEAT_BYTEOFF already handled in there, dont worry 'bout it below */
 	i = ml_replace((linenr_T)1, (char_u *)"", TRUE);
 	buf->b_ml.ml_flags |= ML_EMPTY;
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -3241,8 +3241,7 @@ msgmore(n)
 	    STRCAT(msg_buf, _(" (Interrupted)"));
 	if (msg(msg_buf))
 	{
-	    set_keep_msg(msg_buf);
-	    keep_msg_attr = 0;
+	    set_keep_msg(msg_buf, 0);
 	    keep_msg_more = TRUE;
 	}
     }
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1026,7 +1026,7 @@ free_all_mem()
     vim_free(clip_exclude_prog);
     vim_free(last_cmdline);
     vim_free(new_last_cmdline);
-    set_keep_msg(NULL);
+    set_keep_msg(NULL, 0);
     vim_free(ff_expand_buffer);
 
     /* Clear cmdline history. */
--- a/src/option.c
+++ b/src/option.c
@@ -6524,7 +6524,7 @@ check_stl_option(s)
 	    s++;
 	while (VIM_ISDIGIT(*s))
 	    s++;
-	if (*s == STL_HIGHLIGHT)
+	if (*s == STL_USER_HL)
 	    continue;
 	if (*s == '.')
 	{
--- a/src/option.h
+++ b/src/option.h
@@ -286,8 +286,9 @@
 #define STL_VIM_EXPR	'{'		/* start of expression to substitute */
 #define STL_MIDDLEMARK	'='		/* separation between left and right */
 #define STL_TRUNCMARK	'<'		/* truncation mark if line is too long*/
-#define STL_HIGHLIGHT	'*'		/* highlight from (User)1..9 or 0 */
-#define STL_ALL		((char_u *) "fFtcvVlLknoObBrRhHmYyWwMpPaN{")
+#define STL_USER_HL	'*'		/* highlight from (User)1..9 or 0 */
+#define STL_HIGHLIGHT	'#'		/* highlight name */
+#define STL_ALL		((char_u *) "fFtcvVlLknoObBrRhHmYyWwMpPaN{#")
 
 /* flags used for parsed 'wildmode' */
 #define WIM_FULL	1
--- a/src/screen.c
+++ b/src/screen.c
@@ -146,6 +146,9 @@ static void screen_line __ARGS((int row,
 #ifdef FEAT_VERTSPLIT
 static void draw_vsep_win __ARGS((win_T *wp, int row));
 #endif
+#ifdef FEAT_STL_OPT
+static void redraw_custum_statusline __ARGS((win_T *wp));
+#endif
 #ifdef FEAT_SEARCH_EXTRA
 static void start_search_hl __ARGS((void));
 static void end_search_hl __ARGS((void));
@@ -5334,7 +5337,7 @@ win_redr_status(wp)
     else if (*p_stl != NUL || *wp->w_p_stl != NUL)
     {
 	/* redraw custom status line */
-	win_redr_custom(wp, FALSE);
+	redraw_custum_statusline(wp);
     }
 #endif
     else
@@ -5457,6 +5460,27 @@ win_redr_status(wp)
 #endif
 }
 
+#ifdef FEAT_STL_OPT
+/*
+ * Redraw the status line according to 'statusline' and take care of any
+ * errors encountered.
+ */
+    static void
+redraw_custum_statusline(wp)
+    win_T	    *wp;
+{
+    int	save_called_emsg = called_emsg;
+
+    called_emsg = FALSE;
+    win_redr_custom(wp, FALSE);
+    if (called_emsg)
+	set_string_option_direct((char_u *)"statusline", -1,
+		(char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL
+						   ? OPT_LOCAL : OPT_GLOBAL));
+    called_emsg |= save_called_emsg;
+}
+#endif
+
 # ifdef FEAT_VERTSPLIT
 /*
  * Return TRUE if the status line of window "wp" is connected to the status
@@ -5669,8 +5693,10 @@ win_redr_custom(wp, draw_ruler)
 
 	if (hl[n].userhl == 0)
 	    curattr = attr;
+	else if (hl[n].userhl < 0)
+	    curattr = syn_id2attr(-hl[n].userhl);
 #ifdef FEAT_WINDOWS
-	else if (wp != curwin && wp->w_status_height != 0)
+	else if (wp != NULL && wp != curwin && wp->w_status_height != 0)
 	    curattr = highlight_stlnc[hl[n].userhl - 1];
 #endif
 	else
@@ -6181,7 +6207,14 @@ screen_start_highlight(attr)
 	    if (attr > HL_ALL)				/* special HL attr. */
 	    {
 		if (t_colors > 1)
+		{
 		    aep = syn_cterm_attr2entry(attr);
+		    /* If the Normal FG color has BOLD attribute and the new
+		     * HL has a FG color defined, clear BOLD. */
+		    if (aep != NULL && aep->ae_u.cterm.fg_color
+						      && cterm_normal_fg_bold)
+			out_str(T_ME);
+		}
 		else
 		    aep = syn_term_attr2entry(attr);
 		if (aep == NULL)	    /* did ":syntax clear" */
@@ -8523,112 +8556,122 @@ draw_tabline()
     /* Use the 'tabline' option if it's set. */
     if (*p_tal != NUL)
     {
+	int	save_called_emsg = called_emsg;
+
+	/* Check for an error.  If there is one we would loop in redrawing the
+	 * screen.  Avoid that by making 'tabline' empty. */
+	called_emsg = FALSE;
 	win_redr_custom(NULL, FALSE);
-	return;
-    }
-#endif
-
-    for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
-	++tabcount;
-
-    tabwidth = (Columns - 1 + tabcount / 2) / tabcount;
-    if (tabwidth < 6)
-	tabwidth = 6;
-
-    attr = attr_nosel;
-    tabcount = 0;
-    for (tp = first_tabpage; tp != NULL && col < Columns; tp = tp->tp_next)
-    {
-	scol = col;
-
-	if (tp->tp_topframe == topframe)
-	    attr = attr_sel;
-	if (use_sep_chars && col > 0)
-	    screen_putchar('|', 0, col++, attr);
-
-	if (tp->tp_topframe != topframe)
-	    attr = attr_nosel;
-
-	screen_putchar(' ', 0, col++, attr);
-
-	if (tp->tp_topframe == topframe)
-	{
-	    cwp = curwin;
-	    wp = firstwin;
-	}
-	else
-	{
-	    cwp = tp->tp_curwin;
-	    wp = tp->tp_firstwin;
-	}
-
-	modified = FALSE;
-	for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount)
-	    if (bufIsChanged(wp->w_buffer))
-		modified = TRUE;
-	if (modified || wincount > 1)
-	{
-	    if (wincount > 1)
-	    {
-		vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount);
-		len = STRLEN(NameBuff);
-		screen_puts_len(NameBuff, len, 0, col,
+	if (called_emsg)
+	    set_string_option_direct((char_u *)"tabline", -1,
+						      (char_u *)"", OPT_FREE);
+	called_emsg |= save_called_emsg;
+    }
+    else
+#endif
+    {
+	for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
+	    ++tabcount;
+
+	tabwidth = (Columns - 1 + tabcount / 2) / tabcount;
+	if (tabwidth < 6)
+	    tabwidth = 6;
+
+	attr = attr_nosel;
+	tabcount = 0;
+	for (tp = first_tabpage; tp != NULL && col < Columns; tp = tp->tp_next)
+	{
+	    scol = col;
+
+	    if (tp->tp_topframe == topframe)
+		attr = attr_sel;
+	    if (use_sep_chars && col > 0)
+		screen_putchar('|', 0, col++, attr);
+
+	    if (tp->tp_topframe != topframe)
+		attr = attr_nosel;
+
+	    screen_putchar(' ', 0, col++, attr);
+
+	    if (tp == curtab)
+	    {
+		cwp = curwin;
+		wp = firstwin;
+	    }
+	    else
+	    {
+		cwp = tp->tp_curwin;
+		wp = tp->tp_firstwin;
+	    }
+
+	    modified = FALSE;
+	    for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount)
+		if (bufIsChanged(wp->w_buffer))
+		    modified = TRUE;
+	    if (modified || wincount > 1)
+	    {
+		if (wincount > 1)
+		{
+		    vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount);
+		    len = STRLEN(NameBuff);
+		    screen_puts_len(NameBuff, len, 0, col,
 #if defined(FEAT_SYN_HL)
-				       hl_combine_attr(attr, hl_attr(HLF_T))
+					   hl_combine_attr(attr, hl_attr(HLF_T))
 #else
-				       attr
-#endif
-					   );
-		col += len;
-	    }
-	    if (modified)
-		screen_puts_len((char_u *)"+", 1, 0, col++, attr);
-	    screen_putchar(' ', 0, col++, attr);
-	}
-
-	room = scol - col + tabwidth - 1;
-	if (room > 0)
-	{
-	    if (buf_spname(cwp->w_buffer) != NULL)
-		STRCPY(NameBuff, buf_spname(cwp->w_buffer));
-	    else
-		home_replace(cwp->w_buffer, cwp->w_buffer->b_fname, NameBuff,
-							      MAXPATHL, TRUE);
-	    trans_characters(NameBuff, MAXPATHL);
-	    len = vim_strsize(NameBuff);
-	    p = NameBuff;
+					   attr
+#endif
+					       );
+		    col += len;
+		}
+		if (modified)
+		    screen_puts_len((char_u *)"+", 1, 0, col++, attr);
+		screen_putchar(' ', 0, col++, attr);
+	    }
+
+	    room = scol - col + tabwidth - 1;
+	    if (room > 0)
+	    {
+		if (buf_spname(cwp->w_buffer) != NULL)
+		    STRCPY(NameBuff, buf_spname(cwp->w_buffer));
+		else
+		    home_replace(cwp->w_buffer, cwp->w_buffer->b_fname, NameBuff,
+								  MAXPATHL, TRUE);
+		trans_characters(NameBuff, MAXPATHL);
+		len = vim_strsize(NameBuff);
+		p = NameBuff;
 #ifdef FEAT_MBYTE
-	    if (has_mbyte)
-		while (len > room)
+		if (has_mbyte)
+		    while (len > room)
+		    {
+			len -= ptr2cells(p);
+			mb_ptr_adv(p);
+		    }
+		else
+#endif
+		    if (len > room)
 		{
-		    len -= ptr2cells(p);
-		    mb_ptr_adv(p);
+		    p += len - room;
+		    len = room;
 		}
-	    else
-#endif
-		if (len > room)
-	    {
-		p += len - room;
-		len = room;
-	    }
-
-	    screen_puts_len(p, STRLEN(p), 0, col, attr);
-	    col += len;
-	}
-	screen_putchar(' ', 0, col++, attr);
-
-	/* Store the tab page number in TabPageIdxs[], so that jump_to_mouse()
-	 * knows where each one is. */
-	++tabcount;
-	while (scol < col)
-	    TabPageIdxs[scol++] = tabcount;
-    }
-
-    if (use_sep_chars)
-	c = '_';
-    else
-	c = ' ';
-    screen_fill(0, 1, col, (int)Columns, c, c, attr_fill);
+
+		screen_puts_len(p, STRLEN(p), 0, col, attr);
+		col += len;
+	    }
+	    screen_putchar(' ', 0, col++, attr);
+
+	    /* Store the tab page number in TabPageIdxs[], so that
+	     * jump_to_mouse() knows where each one is. */
+	    ++tabcount;
+	    while (scol < col)
+		TabPageIdxs[scol++] = tabcount;
+	}
+
+	if (use_sep_chars)
+	    c = '_';
+	else
+	    c = ' ';
+	screen_fill(0, 1, col, (int)Columns, c, c, attr_fill);
+    }
 
     /* Put an "X" for closing the current tab if there are several. */
     if (first_tabpage->tp_next != NULL)
@@ -8731,7 +8774,9 @@ showruler(always)
 #endif
 #if defined(FEAT_STL_OPT) && defined(FEAT_WINDOWS)
     if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height)
-	win_redr_custom(curwin, FALSE);
+    {
+	redraw_custum_statusline(curwin);
+    }
     else
 #endif
 #ifdef FEAT_CMDL_INFO
@@ -8802,7 +8847,14 @@ win_redr_ruler(wp, always)
 #ifdef FEAT_STL_OPT
     if (*p_ruf)
     {
+	int	save_called_emsg = called_emsg;
+
+	called_emsg = FALSE;
 	win_redr_custom(wp, TRUE);
+	if (called_emsg)
+	    set_string_option_direct((char_u *)"rulerformat", -1,
+						      (char_u *)"", OPT_FREE);
+	called_emsg |= save_called_emsg;
 	return;
     }
 #endif
--- a/src/structs.h
+++ b/src/structs.h
@@ -919,7 +919,7 @@ struct mapblock
 struct stl_hlrec
 {
     char_u	*start;
-    int		userhl;
+    int		userhl;		/* 0: no HL, 1-9: User HL, < 0 for syn ID */
 };
 
 /* Item for a hashtable.  "hi_key" can be one of three values:
--- a/src/term.c
+++ b/src/term.c
@@ -5401,7 +5401,10 @@ got_code_from_term(code, len)
 		if (i != t_colors)
 		{
 		    /* Nr of colors changed, initialize highlighting and
-		     * redraw everything. */
+		     * redraw everything.  This causes a redraw, which usually
+		     * clears the message.  Try keeping the message if it
+		     * might work. */
+		    set_keep_msg_from_hist();
 		    set_color_count(i);
 		    init_highlight(TRUE, FALSE);
 		    redraw_later(CLEAR);
--- a/src/version.h
+++ b/src/version.h
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT	"vim70aa"
 #define VIM_VERSION_SHORT	"7.0aa"
 #define VIM_VERSION_MEDIUM	"7.0aa ALPHA"
-#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 20)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 20, compiled "
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 21)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 21, compiled "