Blob Blame History Raw
To: vim_dev@googlegroups.com
Subject: Patch 7.3.135
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.135
Problem:    When there is no previous substitute pattern, the previous search
	    pattern is used.  The other way around doesn't work.
Solution:   When there is no previous search pattern, use the previous
	    substitute pattern if possible. (Christian Brabandt)
Files:	    src/search.c


*** ../vim-7.3.134/src/search.c	2010-09-21 16:56:29.000000000 +0200
--- src/search.c	2011-02-25 18:36:56.000000000 +0100
***************
*** 1161,1172 ****
  	{
  	    if (spats[RE_SEARCH].pat == NULL)	    /* no previous pattern */
  	    {
! 		EMSG(_(e_noprevre));
! 		retval = 0;
! 		goto end_do_search;
  	    }
- 	    /* make search_regcomp() use spats[RE_SEARCH].pat */
- 	    searchstr = (char_u *)"";
  	}
  
  	if (pat != NULL && *pat != NUL)	/* look for (new) offset */
--- 1161,1180 ----
  	{
  	    if (spats[RE_SEARCH].pat == NULL)	    /* no previous pattern */
  	    {
! 		pat = spats[RE_SUBST].pat;
! 		if (pat == NULL)
! 		{
! 		    EMSG(_(e_noprevre));
! 		    retval = 0;
! 		    goto end_do_search;
! 		}
! 		searchstr = pat;
! 	    }
! 	    else
! 	    {
! 		/* make search_regcomp() use spats[RE_SEARCH].pat */
! 		searchstr = (char_u *)"";
  	    }
  	}
  
  	if (pat != NULL && *pat != NUL)	/* look for (new) offset */
***************
*** 4527,4533 ****
  #if defined(FEAT_FIND_ID) || defined(PROTO)
  /*
   * Find identifiers or defines in included files.
!  * if p_ic && (compl_cont_status & CONT_SOL) then ptr must be in lowercase.
   */
      void
  find_pattern_in_path(ptr, dir, len, whole, skip_comments,
--- 4535,4541 ----
  #if defined(FEAT_FIND_ID) || defined(PROTO)
  /*
   * Find identifiers or defines in included files.
!  * If p_ic && (compl_cont_status & CONT_SOL) then ptr must be in lowercase.
   */
      void
  find_pattern_in_path(ptr, dir, len, whole, skip_comments,
*** ../vim-7.3.134/src/version.c	2011-02-25 17:10:22.000000000 +0100
--- src/version.c	2011-02-25 18:35:30.000000000 +0100
***************
*** 716,717 ****
--- 716,719 ----
  {   /* Add new patch number below this line */
+ /**/
+     135,
  /**/

-- 
A real patriot is the fellow who gets a parking ticket and rejoices
that the system works.


 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///