0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 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)
This commit is contained in:
Bram Moolenaar 2011-02-25 18:38:36 +01:00
parent ba7cc9f83f
commit b4b0a08c81
2 changed files with 16 additions and 6 deletions

View File

@ -1160,14 +1160,22 @@ do_search(oap, dirc, pat, count, options, tm)
if (pat == NULL || *pat == NUL || *pat == dirc) if (pat == NULL || *pat == NUL || *pat == dirc)
{ {
if (spats[RE_SEARCH].pat == NULL) /* no previous pattern */ if (spats[RE_SEARCH].pat == NULL) /* no previous pattern */
{
pat = spats[RE_SUBST].pat;
if (pat == NULL)
{ {
EMSG(_(e_noprevre)); EMSG(_(e_noprevre));
retval = 0; retval = 0;
goto end_do_search; goto end_do_search;
} }
searchstr = pat;
}
else
{
/* make search_regcomp() use spats[RE_SEARCH].pat */ /* make search_regcomp() use spats[RE_SEARCH].pat */
searchstr = (char_u *)""; searchstr = (char_u *)"";
} }
}
if (pat != NULL && *pat != NUL) /* look for (new) offset */ if (pat != NULL && *pat != NUL) /* look for (new) offset */
{ {
@ -4527,7 +4535,7 @@ linewhite(lnum)
#if defined(FEAT_FIND_ID) || defined(PROTO) #if defined(FEAT_FIND_ID) || defined(PROTO)
/* /*
* Find identifiers or defines in included files. * 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 void
find_pattern_in_path(ptr, dir, len, whole, skip_comments, find_pattern_in_path(ptr, dir, len, whole, skip_comments,

View File

@ -714,6 +714,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
135,
/**/ /**/
134, 134,
/**/ /**/