updated for version 7.0211
diff --git a/src/INSTALLmac.txt b/src/INSTALLmac.txt
index 1c4d773..fa40c15 100644
--- a/src/INSTALLmac.txt
+++ b/src/INSTALLmac.txt
@@ -28,23 +28,32 @@
 1.1 Carbon interface (default)
 
  You can compile vim with the standard Unix routine:
-   cd ..
-   ./configure
-   make; make install
+   cd .../src
+   make
 
  This will create a working Vim.app application bundle in the src
  directory.  You can move this bundle (the Vim.app directory) anywhere
- you want, for example, /Applications.
+ you want.  Or use this command to move it to /Applications:
+   make install
 
  You need at least Xcode 1.5 to compile Vim 7.0.
 
+ Configure will create a universal binary if possible.  This requires
+ installing the universal SDK (currently for 10.4).
+
+ To overrule the architecture do this before running make:
+
+ 	./configure --with-mac-arch=intel
+ or
+ 	./configure --with-mac-arch=ppc
+
 
 1.2 X-Windows or Plain Text
 
  If you do not want the Carbon interface, you must explicitly tell
  configure to use a different GUI.
 
-  cd ..
+  cd .../src
   ./configure --disable-darwin --enable-gui=gtk2
   make; make install
 
diff --git a/src/auto/configure b/src/auto/configure
index ad86242..c69dd96 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -3395,7 +3395,7 @@
     fi
   fi
 
-    if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then
+        if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then
     CFLAGS=`echo "$CFLAGS" | sed 's/-O[23456789]/-Oz/'`
   fi
 
diff --git a/src/configure.in b/src/configure.in
index 60609ec..ea27abb 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -164,7 +164,9 @@
     fi
   fi
 
-  dnl avoid a bug with -O2 for intel
+  dnl Avoid a bug with -O2 with gcc 4.0.  Symptom: malloc() reports double
+  dnl free.  This happens in expand_filename(), because the optimizer swaps
+  dnl two blocks of code that use "repl" that can't be swapped.
   if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then
     CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'`
   fi
diff --git a/src/ops.c b/src/ops.c
index 487ae4c..9695d9d 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -3379,6 +3379,7 @@
 	}
 	curwin->w_cursor.coladd = 0;
 #endif
+	bd.textcol = 0;
 	for (i = 0; i < y_size; ++i)
 	{
 	    int spaces;
@@ -3386,7 +3387,6 @@
 
 	    bd.startspaces = 0;
 	    bd.endspaces = 0;
-	    bd.textcol = 0;
 	    vcol = 0;
 	    delcount = 0;
 
@@ -3536,7 +3536,6 @@
 		    }
 		}
 	    }
-	    new_cursor = curwin->w_cursor;
 	    curbuf->b_op_start = curwin->w_cursor;
 	}
 	/*
@@ -3544,6 +3543,7 @@
 	 */
 	else if (dir == BACKWARD)
 	    --lnum;
+	new_cursor = curwin->w_cursor;
 
 	/*
 	 * simple case: insert into current line
diff --git a/src/option.c b/src/option.c
index e67586b..d692edf 100644
--- a/src/option.c
+++ b/src/option.c
@@ -2295,6 +2295,13 @@
 			    (char_u *)NULL, PV_NONE,
 #endif
 			    {(char_u *)"", (char_u *)0L}},
+    {"tabpagemax",  "tpm",  P_NUM|P_VI_DEF,
+#ifdef FEAT_WINDOWS
+			    (char_u *)&p_tpm, PV_NONE,
+#else
+			    (char_u *)NULL, PV_NONE,
+#endif
+			    {(char_u *)10L, (char_u *)0L}},
     {"tabstop",	    "ts",   P_NUM|P_VI_DEF|P_RBUF,
 			    (char_u *)&p_ts, PV_TS,
 			    {(char_u *)8L, (char_u *)0L}},
diff --git a/src/option.h b/src/option.h
index 7f70b15..1ed2a4f 100644
--- a/src/option.h
+++ b/src/option.h
@@ -710,6 +710,7 @@
 EXTERN int	p_sta;		/* 'smarttab' */
 #ifdef FEAT_WINDOWS
 EXTERN int	p_sb;		/* 'splitbelow' */
+EXTERN long	p_tpm;		/* 'tabpagemax' */
 # if defined(FEAT_STL_OPT)
 EXTERN char_u	*p_tal;		/* 'tabline' */
 # endif
diff --git a/src/screen.c b/src/screen.c
index 391fe0a..f799b58 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -115,7 +115,7 @@
 } match_T;
 
 static match_T search_hl;	/* used for 'hlsearch' highlight matching */
-static match_T match_hl;	/* used for ":match" highlight matching */
+static match_T match_hl[3];	/* used for ":match" highlight matching */
 #endif
 
 #ifdef FEAT_FOLDING
@@ -833,14 +833,19 @@
 #endif
 
 #ifdef FEAT_SEARCH_EXTRA
-    /* Setup for ":match" highlighting.  Disable any previous match */
-    match_hl.rm = wp->w_match;
-    if (wp->w_match_id == 0)
-	match_hl.attr = 0;
-    else
-	match_hl.attr = syn_id2attr(wp->w_match_id);
-    match_hl.buf = buf;
-    match_hl.lnum = 0;
+    /* Setup for ":match" and 'hlsearch' highlighting.  Disable any previous
+     * match */
+    for (i = 0; i < 3; ++i)
+    {
+	match_hl[i].rm = wp->w_match[i];
+	if (wp->w_match_id[i] == 0)
+	    match_hl[i].attr = 0;
+	else
+	    match_hl[i].attr = syn_id2attr(wp->w_match_id[i]);
+	match_hl[i].buf = buf;
+	match_hl[i].lnum = 0;
+	match_hl[i].first_lnum = 0;
+    }
     search_hl.buf = buf;
     search_hl.lnum = 0;
     search_hl.first_lnum = 0;
@@ -905,11 +910,17 @@
 	     * lines above the change.
 	     * Same for a ":match" pattern.
 	     */
-	    if ((search_hl.rm.regprog != NULL
-			&& re_multiline(search_hl.rm.regprog))
-		    || (match_hl.rm.regprog != NULL
-			&& re_multiline(match_hl.rm.regprog)))
+	    if (search_hl.rm.regprog != NULL
+					&& re_multiline(search_hl.rm.regprog))
 		top_to_mod = TRUE;
+	    else
+		for (i = 0; i < 3; ++i)
+		    if (match_hl[i].rm.regprog != NULL
+				      && re_multiline(match_hl[i].rm.regprog))
+		    {
+			top_to_mod = TRUE;
+			break;
+		    }
 #endif
 	}
 #ifdef FEAT_FOLDING
@@ -2570,6 +2581,7 @@
 #endif
 #ifdef FEAT_SEARCH_EXTRA
     match_T	*shl;			/* points to search_hl or match_hl */
+    int		i;
 #endif
 #ifdef FEAT_ARABIC
     int		prev_c = 0;		/* previous Arabic character */
@@ -3007,12 +3019,12 @@
 
 #ifdef FEAT_SEARCH_EXTRA
     /*
-     * Handle highlighting the last used search pattern.
-     * Do this for both search_hl and match_hl.
+     * Handle highlighting the last used search pattern and ":match".
+     * Do this for both search_hl and match_hl[3].
      */
-    shl = &search_hl;
-    for (;;)
+    for (i = 3; i >= 0; --i)
     {
+	shl = (i == 3) ? &search_hl : &match_hl[i];
 	shl->startcol = MAXCOL;
 	shl->endcol = MAXCOL;
 	shl->attr_cur = 0;
@@ -3055,9 +3067,6 @@
 		area_highlighting = TRUE;
 	    }
 	}
-	if (shl == &match_hl)
-	    break;
-	shl = &match_hl;
     }
 #endif
 
@@ -3305,9 +3314,9 @@
 		 * ":match" overrules 'hlsearch'.
 		 */
 		v = (long)(ptr - line);
-		shl = &search_hl;
-		for (;;)
+		for (i = 3; i >= 0; --i)
 		{
+		    shl = (i == 3) ? &search_hl : &match_hl[i];
 		    while (shl->rm.regprog != NULL)
 		    {
 			if (shl->startcol != MAXCOL
@@ -3355,15 +3364,17 @@
 			}
 			break;
 		    }
-		    if (shl == &match_hl)
-			break;
-		    shl = &match_hl;
 		}
+
 		/* ":match" highlighting overrules 'hlsearch' */
-		if (match_hl.attr_cur != 0)
-		    search_attr = match_hl.attr_cur;
-		else
-		    search_attr = search_hl.attr_cur;
+		for (i = 0; i <= 3; ++i)
+		    if (i == 3)
+			search_attr = search_hl.attr_cur;
+		    else if (match_hl[i].attr_cur != 0)
+		    {
+			search_attr = match_hl[i].attr_cur;
+			break;
+		    }
 	    }
 #endif
 
@@ -4133,7 +4144,9 @@
 #ifdef FEAT_SEARCH_EXTRA
 			/* highlight 'hlsearch' match at end of line */
 			|| (ptr - line) - 1 == (long)search_hl.startcol
-			|| (ptr - line) - 1 == (long)match_hl.startcol
+			|| (ptr - line) - 1 == (long)match_hl[0].startcol
+			|| (ptr - line) - 1 == (long)match_hl[1].startcol
+			|| (ptr - line) - 1 == (long)match_hl[2].startcol
 #endif
 		       ))
 	    {
@@ -4170,10 +4183,16 @@
 #ifdef FEAT_SEARCH_EXTRA
 		if (area_attr == 0)
 		{
-		    if ((ptr - line) - 1 == (long)match_hl.startcol)
-			char_attr = match_hl.attr;
-		    else
-			char_attr = search_hl.attr;
+		    for (i = 0; i <= 3; ++i)
+		    {
+			if (i == 3)
+			    char_attr = search_hl.attr;
+			else if ((ptr - line) - 1 == (long)match_hl[i].startcol)
+			{
+			    char_attr = match_hl[i].attr;
+			    break;
+			}
+		    }
 		}
 #endif
 		ScreenAttrs[off] = char_attr;
@@ -6061,15 +6080,16 @@
 {
     match_T	*shl;		/* points to search_hl or match_hl */
     int		n;
+    int		i;
 
     /*
      * When using a multi-line pattern, start searching at the top
      * of the window or just after a closed fold.
-     * Do this both for search_hl and match_hl.
+     * Do this both for search_hl and match_hl[3].
      */
-    shl = &search_hl;
-    for (;;)
+    for (i = 3; i >= 0; --i)
     {
+	shl = (i == 3) ? &search_hl : &match_hl[i];
 	if (shl->rm.regprog != NULL
 		&& shl->lnum == 0
 		&& re_multiline(shl->rm.regprog))
@@ -6104,9 +6124,6 @@
 		}
 	    }
 	}
-	if (shl == &match_hl)
-	    break;
-	shl = &match_hl;
     }
 }
 
@@ -6884,12 +6901,8 @@
      * Continuing with the old ScreenLines may result in a crash, because the
      * size is wrong.
      */
-#ifdef FEAT_WINDOWS
     FOR_ALL_TAB_WINDOWS(tp, wp)
 	win_free_lsize(wp);
-#else
-    win_free_lsize(curwin);
-#endif
 
     new_ScreenLines = (schar_T *)lalloc((long_u)(
 			      (Rows + 1) * Columns * sizeof(schar_T)), FALSE);
@@ -8622,7 +8635,8 @@
 	attr = attr_nosel;
 	tabcount = 0;
 	scol = 0;
-	for (tp = first_tabpage; tp != NULL && col < Columns; tp = tp->tp_next)
+	for (tp = first_tabpage; tp != NULL && col < Columns - 4;
+							     tp = tp->tp_next)
 	{
 	    scol = col;
 
@@ -8657,6 +8671,8 @@
 		{
 		    vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount);
 		    len = STRLEN(NameBuff);
+		    if (col + len >= Columns - 3)
+			break;
 		    screen_puts_len(NameBuff, len, 0, col,
 #if defined(FEAT_SYN_HL)
 					   hl_combine_attr(attr, hl_attr(HLF_T))
@@ -8692,6 +8708,8 @@
 		    p += len - room;
 		    len = room;
 		}
+		if (len > Columns - col - 1)
+		    len = Columns - col - 1;
 
 		screen_puts_len(p, STRLEN(p), 0, col, attr);
 		col += len;
diff --git a/src/search.c b/src/search.c
index 27b9ac1..163605c 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1891,6 +1891,8 @@
 
     do_quotes = -1;
     start_in_quotes = MAYBE;
+    clearpos(&match_pos);
+
     /* backward search: Check if this line contains a single-line comment */
     if ((backwards && comment_dir)
 #ifdef FEAT_LISP
@@ -3096,6 +3098,7 @@
     int		include_white = FALSE;
 
     cls_bigword = bigword;
+    clearpos(&start_pos);
 
 #ifdef FEAT_VISUAL
     /* Correct cursor when 'selection' is exclusive */
diff --git a/src/structs.h b/src/structs.h
index 0d6e497..5b1aed6 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1894,8 +1894,8 @@
 #endif
 
 #ifdef FEAT_SEARCH_EXTRA
-    regmmatch_T	w_match;	/* regexp program for ":match" */
-    int		w_match_id;	/* highlight ID for ":match" */
+    regmmatch_T	w_match[3];	/* regexp programs for ":match" */
+    int		w_match_id[3];	/* highlight IDs for ":match" */
 #endif
 
     /*
diff --git a/src/syntax.c b/src/syntax.c
index a96dc77..b6bc696 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -780,6 +780,8 @@
 	else
 	    break_lnum = 0;
 
+	found_m_endpos.lnum = 0;
+	found_m_endpos.col = 0;
 	end_lnum = start_lnum;
 	lnum = start_lnum;
 	while (--lnum > break_lnum)
diff --git a/src/term.c b/src/term.c
index c3c5979..99dc1b0 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3918,6 +3918,7 @@
 	    continue;
 
 	key_name[0] = NUL;	/* no key name found yet */
+	key_name[1] = NUL;	/* no key name found yet */
 	modifiers = 0;		/* no modifiers yet */
 
 #ifdef FEAT_GUI
diff --git a/src/testdir/test59.in b/src/testdir/test59.in
index e3de1d6..368191c 100644
--- a/src/testdir/test59.in
+++ b/src/testdir/test59.in
@@ -121,7 +121,7 @@
 RAR ?
 BAD !
 
-NOSPLITSUGS
+#NOSPLITSUGS
 
 PFX I N 1
 PFX I 0 in .
@@ -169,7 +169,7 @@
 RAR ?
 BAD !
 
-NOSPLITSUGS
+#NOSPLITSUGS
 
 PFX I N 1
 PFX I 0 in .
@@ -326,7 +326,7 @@
 RAR ?
 BAD !
 
-NOSPLITSUGS
+#NOSPLITSUGS
 
 PFX I N 1
 PFX I 0 in .
diff --git a/src/version.h b/src/version.h
index 33aedab..7ebf483 100644
--- 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 28)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 28, compiled "
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 1)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 1, compiled "