updated for version 7.0077
diff --git a/src/charset.c b/src/charset.c
index c05a83d..25680f6 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1829,7 +1829,7 @@
 }
 
 /*
- * skipdigits: skip over digits;
+ * skip over digits
  */
     char_u *
 skipdigits(p)
@@ -1840,6 +1840,32 @@
     return p;
 }
 
+#if defined(FEAT_EX_EXTRA) || defined(PROTO)
+/*
+ * skip to digit (or NUL after the string)
+ */
+    char_u *
+skiptodigit(p)
+    char_u	*p;
+{
+    while (*p != NUL && !VIM_ISDIGIT(*p))	/* skip to next digit */
+	++p;
+    return p;
+}
+
+/*
+ * skip to hex character (or NUL after the string)
+ */
+    char_u *
+skiptohex(p)
+    char_u	*p;
+{
+    while (*p != NUL && !vim_isxdigit(*p))	/* skip to next digit */
+	++p;
+    return p;
+}
+#endif
+
 /*
  * Variant of isdigit() that can handle characters > 0x100.
  * We don't use isdigit() here, because on some systems it also considers
@@ -1942,6 +1968,10 @@
  * If "len" is not NULL, the length of the number in characters is returned.
  * If "nptr" is not NULL, the signed result is returned in it.
  * If "unptr" is not NULL, the unsigned result is returned in it.
+ * If "dooct" is non-zero recognize octal numbers, when > 1 always assume
+ * octal number.
+ * If "dohext" is non-zero recognize hex numbers, when > 1 always assume
+ * hex number.
  */
     void
 vim_str2nr(start, hexp, len, dooct, dohex, nptr, unptr)
@@ -1995,25 +2025,22 @@
     /*
      * Do the string-to-numeric conversion "manually" to avoid sscanf quirks.
      */
-    if (hex)
+    if (hex == '0' || dooct > 1)
     {
-	if (hex == '0')
+	/* octal */
+	while ('0' <= *ptr && *ptr <= '7')
 	{
-	    /* octal */
-	    while ('0' <= *ptr && *ptr <= '7')
-	    {
-		un = 8 * un + (unsigned long)(*ptr - '0');
-		++ptr;
-	    }
+	    un = 8 * un + (unsigned long)(*ptr - '0');
+	    ++ptr;
 	}
-	else
+    }
+    else if (hex != 0 || dohex > 1)
+    {
+	/* hex */
+	while (vim_isxdigit(*ptr))
 	{
-	    /* hex */
-	    while (vim_isxdigit(*ptr))
-	    {
-		un = 16 * un + (unsigned long)hex2nr(*ptr);
-		++ptr;
-	    }
+	    un = 16 * un + (unsigned long)hex2nr(*ptr);
+	    ++ptr;
 	}
     }
     else
diff --git a/src/ex_eval.c b/src/ex_eval.c
index d6c4ebe..485721b 100644
--- a/src/ex_eval.c
+++ b/src/ex_eval.c
@@ -523,14 +523,22 @@
 
 	if (debug_break_level > 0)
 	    msg_silent = FALSE;		/* display messages */
+	else
+	    verbose_enter();
 	++no_wait_return;
-	msg_scroll = TRUE;	    /* always scroll up, don't overwrite */
+	if (debug_break_level > 0 || *p_vfile == NUL)
+	    msg_scroll = TRUE;	    /* always scroll up, don't overwrite */
+
 	smsg((char_u *)_("Exception thrown: %s"), excp->value);
 	msg_puts((char_u *)"\n");   /* don't overwrite this either */
-	cmdline_row = msg_row;
+
+	if (debug_break_level > 0 || *p_vfile == NUL)
+	    cmdline_row = msg_row;
 	--no_wait_return;
 	if (debug_break_level > 0)
 	    msg_silent = save_msg_silent;
+	else
+	    verbose_leave();
     }
 
     current_exception = excp;
@@ -569,17 +577,23 @@
 	saved_IObuff = vim_strsave(IObuff);
 	if (debug_break_level > 0)
 	    msg_silent = FALSE;		/* display messages */
+	else
+	    verbose_enter();
 	++no_wait_return;
-	msg_scroll = TRUE;	    /* always scroll up, don't overwrite */
+	if (debug_break_level > 0 || *p_vfile == NUL)
+	    msg_scroll = TRUE;	    /* always scroll up, don't overwrite */
 	smsg(was_finished
 		    ? (char_u *)_("Exception finished: %s")
 		    : (char_u *)_("Exception discarded: %s"),
 		excp->value);
 	msg_puts((char_u *)"\n");   /* don't overwrite this either */
-	cmdline_row = msg_row;
+	if (debug_break_level > 0 || *p_vfile == NUL)
+	    cmdline_row = msg_row;
 	--no_wait_return;
 	if (debug_break_level > 0)
 	    msg_silent = save_msg_silent;
+	else
+	    verbose_leave();
 	STRCPY(IObuff, saved_IObuff);
 	vim_free(saved_IObuff);
     }
@@ -632,14 +646,22 @@
 
 	if (debug_break_level > 0)
 	    msg_silent = FALSE;		/* display messages */
+	else
+	    verbose_enter();
 	++no_wait_return;
-	msg_scroll = TRUE;	    /* always scroll up, don't overwrite */
+	if (debug_break_level > 0 || *p_vfile == NUL)
+	    msg_scroll = TRUE;	    /* always scroll up, don't overwrite */
+
 	smsg((char_u *)_("Exception caught: %s"), excp->value);
 	msg_puts((char_u *)"\n");   /* don't overwrite this either */
-	cmdline_row = msg_row;
+
+	if (debug_break_level > 0 || *p_vfile == NUL)
+	    cmdline_row = msg_row;
 	--no_wait_return;
 	if (debug_break_level > 0)
 	    msg_silent = save_msg_silent;
+	else
+	    verbose_leave();
     }
 }
 
@@ -785,7 +807,13 @@
     void	*value;
 {
     if (p_verbose >= 14 || debug_break_level > 0)
+    {
+	if (debug_break_level <= 0)
+	    verbose_enter();
 	report_pending(RP_MAKE, pending, value);
+	if (debug_break_level <= 0)
+	    verbose_leave();
+    }
 }
 
 /*
@@ -798,7 +826,13 @@
     void	*value;
 {
     if (p_verbose >= 14 || debug_break_level > 0)
+    {
+	if (debug_break_level <= 0)
+	    verbose_enter();
 	report_pending(RP_RESUME, pending, value);
+	if (debug_break_level <= 0)
+	    verbose_leave();
+    }
 }
 
 /*
@@ -811,7 +845,13 @@
     void	*value;
 {
     if (p_verbose >= 14 || debug_break_level > 0)
+    {
+	if (debug_break_level <= 0)
+	    verbose_enter();
 	report_pending(RP_DISCARD, pending, value);
+	if (debug_break_level <= 0)
+	    verbose_leave();
+    }
 }
 
 
diff --git a/src/gui_w32.c b/src/gui_w32.c
index e83ff40..8d0a4ce 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -3966,6 +3966,7 @@
 	vim_free(sign);
     }
 }
+#endif
 
 #if defined(FEAT_BEVAL) || defined(PROTO)
 
@@ -4231,5 +4232,3 @@
     SetPixel(s_hdc, x+2, y, gui.currFgColor);
 }
 #endif
-
-#endif
diff --git a/src/if_cscope.c b/src/if_cscope.c
index 1b07713..9693f84 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -1130,7 +1130,7 @@
 	if (matches == NULL)
 	    return FALSE;
 
-	(void)cs_manage_matches(matches, contexts, totmatches, Store);
+	(void)cs_manage_matches(matches, contexts, matched, Store);
 
 	return do_tag((char_u *)pat, DT_CSCOPE, 0, forceit, verbose);
     }
@@ -1693,8 +1693,8 @@
 
 	for (j = 0; j < nummatches_a[i]; j++)
 	{
-	   if ((fullname=cs_parse_results(i, buf, CSREAD_BUFSIZE, &cntx,
-			   &slno, &search))==NULL)
+	   if ((fullname = cs_parse_results(i, buf, CSREAD_BUFSIZE, &cntx,
+			   &slno, &search)) == NULL)
 	       continue;
 
 	   context = (char *)alloc(strlen(cntx)+5);
diff --git a/src/misc2.c b/src/misc2.c
index 879384a..a1e8c12 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -2606,10 +2606,12 @@
 
     if (p_verbose > 3)
     {
+	verbose_enter();
 	smsg((char_u *)_("Calling shell to execute: \"%s\""),
 						    cmd == NULL ? p_sh : cmd);
 	out_char('\n');
 	cursor_on();
+	verbose_leave();
     }
 
 #ifdef FEAT_PROFILE
@@ -4059,13 +4061,12 @@
 #ifdef FF_VERBOSE
 		if (p_verbose >= 5)
 		{
-		    /* always scroll up, don't overwrite */
-		    msg_scroll = TRUE;
+		    verbose_enter_scroll();
 		    smsg((char_u *)"Already Searched: %s (%s)",
 					   ctx->ffs_fix_path, ctx->ffs_wc_path);
 		    /* don't overwrite this either */
 		    msg_puts((char_u *)"\n");
-		    cmdline_row = msg_row;
+		    verbose_leave_scroll();
 		}
 #endif
 		ff_free_stack_element(ctx);
@@ -4074,13 +4075,12 @@
 #ifdef FF_VERBOSE
 	    else if (p_verbose >= 5)
 	    {
-		/* always scroll up, don't overwrite */
-		msg_scroll = TRUE;
+		verbose_enter_scroll();
 		smsg((char_u *)"Searching: %s (%s)",
 					 ctx->ffs_fix_path, ctx->ffs_wc_path);
 		/* don't overwrite this either */
 		msg_puts((char_u *)"\n");
-		cmdline_row = msg_row;
+		verbose_leave_scroll();
 	    }
 #endif
 
@@ -4264,13 +4264,12 @@
 				{
 				    if (p_verbose >= 5)
 				    {
-					/* always scroll up, don't overwrite */
-					msg_scroll = TRUE;
+					verbose_enter_scroll();
 					smsg((char_u *)"Already: %s",
 								   file_path);
 					/* don't overwrite this either */
 					msg_puts((char_u *)"\n");
-					cmdline_row = msg_row;
+					verbose_leave_scroll();
 				    }
 				    continue;
 				}
@@ -4293,12 +4292,11 @@
 #ifdef FF_VERBOSE
 				if (p_verbose >= 5)
 				{
-				    /* always scroll up, don't overwrite */
-				    msg_scroll = TRUE;
+				    verbose_enter_scroll();
 				    smsg((char_u *)"HIT: %s", file_path);
 				    /* don't overwrite this either */
 				    msg_puts((char_u *)"\n");
-				    cmdline_row = msg_row;
+				    verbose_leave_scroll();
 				}
 #endif
 				return file_path;
@@ -4483,13 +4481,12 @@
 #ifdef FF_VERBOSE
 		if (p_verbose >= 5)
 		{
-		    /* always scroll up, don't overwrite */
-		    msg_scroll = TRUE;
+		    verbose_enter_scroll();
 		    smsg((char_u *)"ff_get_visited_list: FOUND list for %s",
 								    filename);
 		    /* don't overwrite this either */
 		    msg_puts((char_u *)"\n");
-		    cmdline_row = msg_row;
+		    verbose_leave_scroll();
 		}
 #endif
 		return retptr;
@@ -4501,12 +4498,11 @@
 #ifdef FF_VERBOSE
     if (p_verbose >= 5)
     {
-	/* always scroll up, don't overwrite */
-	msg_scroll = TRUE;
+	verbose_enter_scroll();
 	smsg((char_u *)"ff_get_visited_list: new list for %s", filename);
 	/* don't overwrite this either */
 	msg_puts((char_u *)"\n");
-	cmdline_row = msg_row;
+	verbose_leave_scroll();
     }
 #endif
 
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index b6d9350..cfe2134 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -24,7 +24,7 @@
 		test38.out test39.out test40.out test41.out test42.out \
 		test43.out test44.out test45.out test46.out test47.out \
 		test48.out test51.out test53.out test54.out test55.out \
-		test56.out
+		test56.out test57.out
 
 .SUFFIXES: .in .out
 
@@ -100,3 +100,4 @@
 test54.out: test54.in
 test55.out: test55.in
 test56.out: test56.in
+test57.out: test57.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index f8816ec..6ca1acc 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -18,7 +18,7 @@
 		test35.out test36.out test43.out \
 		test44.out test45.out test46.out test47.out \
 		test48.out test51.out test53.out test54.out \
-		test55.out test56.out
+		test55.out test56.out test57.out
 
 SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test8.out test9.out test11.out test13.out test14.out \
diff --git a/src/testdir/test55.ok b/src/testdir/test55.ok
index 438a9f2..caec674 100644
--- a/src/testdir/test55.ok
+++ b/src/testdir/test55.ok
@@ -83,3 +83,5 @@
 ['aa', '', 'bb']
 ['', 'aa', '', 'bb', '']
 ['aa', '', 'bb', 'cc', '']
+['a', 'b', 'c']
+['', 'a', '', 'b', '', 'c', '']
diff --git a/src/testdir/test57.in b/src/testdir/test57.in
new file mode 100644
index 0000000..7e70169
--- /dev/null
+++ b/src/testdir/test57.in
@@ -0,0 +1,52 @@
+Tests for :sort command.     vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:"
+:/^t1:/+1,/^t2/-1sort
+:/^t2:/+1,/^t3/-1sort u
+:/^t3:/+1,/^t4/-1sort u /[^:]*:/
+:/^t4:/+1,/^t5/-1sort n
+:/^t5:/+1,/^t6/-1sort n -[^:]*:-
+:/^t6:/+1,/^t7/-1sort o
+:/^t7:/+1,/^t8/-1sort x ,.*/,
+:/^t8:/+1,/^t9/-1sort n o
+:/^t1:/,$wq! test.out
+ENDTEST
+
+t1: alphabetical
+two test
+One test
+one test
+Two test
+t2: alpha, unique
+One test
+one test
+Two test
+one test
+Two test 
+t3: alpha, unique, skip pattern
+one: xay
+two: aaa
+another: tuvy
+t4: number
+asdf 83 asd
+one 333   
+xce   9
+t5: number and skip
+asdf 3 a: sd 11
+one 33:4   99
+:9 
+t6: octal
+2389
+111
+asdf 0014
+t7: hex and skip
+sf/0x1d3
+0x44/1a1
+asd/ad 1413
+t8: wrong arguments
+ccc
+bbb
+aaa
+t8:
diff --git a/src/version.h b/src/version.h
index ba96d65..995acf4 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 (2005 May 27)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 May 27, compiled "
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2005 May 31)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 May 31, compiled "