Karsten Hopp 640b8b
To: vim-dev@vim.org
Karsten Hopp 640b8b
Subject: patch 7.1.028
Karsten Hopp 640b8b
Fcc: outbox
Karsten Hopp 640b8b
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 640b8b
Mime-Version: 1.0
Karsten Hopp 640b8b
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 640b8b
Content-Transfer-Encoding: 8bit
Karsten Hopp 640b8b
------------
Karsten Hopp 640b8b
Karsten Hopp 640b8b
Patch 7.1.028
Karsten Hopp 640b8b
Problem:    Can't use last search pattern for ":sort". (Brian McKee)
Karsten Hopp 640b8b
Solution:   When the pattern is emtpy use the last search pattern. (Martin
Karsten Hopp 640b8b
	    Toft)
Karsten Hopp 640b8b
Files:	    runtime/doc/change.txt, src/ex_cmds.c
Karsten Hopp 640b8b
Karsten Hopp 640b8b
Karsten Hopp 640b8b
*** ../vim-7.1.027/runtime/doc/change.txt	Sat May 12 16:10:12 2007
Karsten Hopp 640b8b
--- runtime/doc/change.txt	Tue Jul 10 11:30:56 2007
Karsten Hopp 640b8b
***************
Karsten Hopp 640b8b
*** 1571,1576 ****
Karsten Hopp 640b8b
--- 1571,1580 ----
Karsten Hopp 640b8b
  			in their original order, right before the sorted
Karsten Hopp 640b8b
  			lines.
Karsten Hopp 640b8b
  
Karsten Hopp 640b8b
+ 			If {pattern} is empty (e.g. // is specified), the
Karsten Hopp 640b8b
+ 			last search pattern is used.  This allows trying out
Karsten Hopp 640b8b
+ 			a pattern first.
Karsten Hopp 640b8b
+ 
Karsten Hopp 640b8b
  Note that using ":sort" with ":global" doesn't sort the matching lines, it's
Karsten Hopp 640b8b
  quite useless.
Karsten Hopp 640b8b
  
Karsten Hopp 640b8b
*** ../vim-7.1.027/src/ex_cmds.c	Thu Jun 28 21:57:08 2007
Karsten Hopp 640b8b
--- src/ex_cmds.c	Tue Jul 10 17:25:10 2007
Karsten Hopp 640b8b
***************
Karsten Hopp 640b8b
*** 408,414 ****
Karsten Hopp 640b8b
  		goto sortend;
Karsten Hopp 640b8b
  	    }
Karsten Hopp 640b8b
  	    *s = NUL;
Karsten Hopp 640b8b
! 	    regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC);
Karsten Hopp 640b8b
  	    if (regmatch.regprog == NULL)
Karsten Hopp 640b8b
  		goto sortend;
Karsten Hopp 640b8b
  	    p = s;		/* continue after the regexp */
Karsten Hopp 640b8b
--- 408,418 ----
Karsten Hopp 640b8b
  		goto sortend;
Karsten Hopp 640b8b
  	    }
Karsten Hopp 640b8b
  	    *s = NUL;
Karsten Hopp 640b8b
! 	    /* Use last search pattern if sort pattern is empty. */
Karsten Hopp 640b8b
! 	    if (s == p + 1 && last_search_pat() != NULL)
Karsten Hopp 640b8b
! 		regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC);
Karsten Hopp 640b8b
! 	    else
Karsten Hopp 640b8b
! 		regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC);
Karsten Hopp 640b8b
  	    if (regmatch.regprog == NULL)
Karsten Hopp 640b8b
  		goto sortend;
Karsten Hopp 640b8b
  	    p = s;		/* continue after the regexp */
Karsten Hopp 640b8b
*** ../vim-7.1.027/src/version.c	Tue Jul 10 17:09:51 2007
Karsten Hopp 640b8b
--- src/version.c	Tue Jul 10 17:20:01 2007
Karsten Hopp 640b8b
***************
Karsten Hopp 640b8b
*** 668,669 ****
Karsten Hopp 640b8b
--- 668,671 ----
Karsten Hopp 640b8b
  {   /* Add new patch number below this line */
Karsten Hopp 640b8b
+ /**/
Karsten Hopp 640b8b
+     28,
Karsten Hopp 640b8b
  /**/
Karsten Hopp 640b8b
Karsten Hopp 640b8b
-- 
Karsten Hopp 640b8b
Every person is responsible for the choices he makes.
Karsten Hopp 640b8b
Karsten Hopp 640b8b
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 640b8b
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 640b8b
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 640b8b
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///