]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.135 v7.3.135
authorBram Moolenaar <Bram@vim.org>
Fri, 25 Feb 2011 17:38:36 +0000 (18:38 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 25 Feb 2011 17:38:36 +0000 (18:38 +0100)
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)

src/search.c
src/version.c

index 1c971ffda8c9f8765ae1347335ec8a4359b8c92d..fc820b908a23650bb66b63295a5dceed870779fa 100644 (file)
@@ -1161,12 +1161,20 @@ do_search(oap, dirc, pat, count, options, tm)
        {
            if (spats[RE_SEARCH].pat == NULL)       /* no previous pattern */
            {
-               EMSG(_(e_noprevre));
-               retval = 0;
-               goto end_do_search;
+               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 *)"";
            }
-           /* make search_regcomp() use spats[RE_SEARCH].pat */
-           searchstr = (char_u *)"";
        }
 
        if (pat != NULL && *pat != NUL) /* look for (new) offset */
@@ -4527,7 +4535,7 @@ linewhite(lnum)
 #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.
+ * 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,
index 163bf295b9688b5a02666360de32879746aff2ad..a05dc15bfe92229c5fe50f36250d416d2d79dfab 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    135,
 /**/
     134,
 /**/