diff options
Diffstat (limited to 'src/search.c')
-rw-r--r-- | src/search.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/search.c b/src/search.c index 1c971ffda..fc820b908 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, |