summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-02-25 18:38:36 +0100
committerBram Moolenaar <Bram@vim.org>2011-02-25 18:38:36 +0100
commitb4b0a08c817309e90f467f727947a024c47183ea (patch)
tree5b22bfd98b9be805eaf90309832ecc3cbff32adb
parentba7cc9f83f76fcda2ce7b1bca7e140cad47bde10 (diff)
updated for version 7.3.135v7.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)
-rw-r--r--src/search.c20
-rw-r--r--src/version.c2
2 files changed, 16 insertions, 6 deletions
diff --git a/src/search.c b/src/search.c
index 1c971ffda8..fc820b908a 100644
--- a/src/search.c
+++ b/src/search.c
@@ -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,
diff --git a/src/version.c b/src/version.c
index 163bf295b9..a05dc15bfe 100644
--- a/src/version.c
+++ b/src/version.c
@@ -715,6 +715,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 135,
+/**/
134,
/**/
133,