vim-patch:7.4.2239

Problem:    Warning for missing declaration of skip_vimgrep_pat(). (John
            Marriott)
Solution:   Move it to another file.

9baf297c99
This commit is contained in:
James McCoy
2017-04-29 07:55:15 -04:00
parent dbdc2d40bb
commit 059c3fc2f9
3 changed files with 45 additions and 47 deletions

View File

@@ -6159,6 +6159,50 @@ void ex_substitute(exarg_T *eap)
unblock_autocmds(); unblock_autocmds();
} }
/// Skip over the pattern argument of ":vimgrep /pat/[g][j]".
/// Put the start of the pattern in "*s", unless "s" is NULL.
/// If "flags" is not NULL put the flags in it: VGR_GLOBAL, VGR_NOJUMP.
/// If "s" is not NULL terminate the pattern with a NUL.
/// Return a pointer to the char just past the pattern plus flags.
char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags)
{
int c;
if (vim_isIDc(*p)) {
// ":vimgrep pattern fname"
if (s != NULL)
*s = p;
p = skiptowhite(p);
if (s != NULL && *p != NUL)
*p++ = NUL;
} else {
// ":vimgrep /pattern/[g][j] fname"
if (s != NULL)
*s = p + 1;
c = *p;
p = skip_regexp(p + 1, c, TRUE, NULL);
if (*p != c)
return NULL;
// Truncate the pattern.
if (s != NULL)
*p = NUL;
++p;
// Find the flags
while (*p == 'g' || *p == 'j') {
if (flags != NULL) {
if (*p == 'g')
*flags |= VGR_GLOBAL;
else
*flags |= VGR_NOJUMP;
}
++p;
}
}
return p;
}
/// List v:oldfiles in a nice way. /// List v:oldfiles in a nice way.
void ex_oldfiles(exarg_T *eap) void ex_oldfiles(exarg_T *eap)
{ {

View File

@@ -3765,52 +3765,6 @@ theend:
vim_regfree(regmatch.regprog); vim_regfree(regmatch.regprog);
} }
/*
* Skip over the pattern argument of ":vimgrep /pat/[g][j]".
* Put the start of the pattern in "*s", unless "s" is NULL.
* If "flags" is not NULL put the flags in it: VGR_GLOBAL, VGR_NOJUMP.
* If "s" is not NULL terminate the pattern with a NUL.
* Return a pointer to the char just past the pattern plus flags.
*/
char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags)
{
int c;
if (vim_isIDc(*p)) {
/* ":vimgrep pattern fname" */
if (s != NULL)
*s = p;
p = skiptowhite(p);
if (s != NULL && *p != NUL)
*p++ = NUL;
} else {
/* ":vimgrep /pattern/[g][j] fname" */
if (s != NULL)
*s = p + 1;
c = *p;
p = skip_regexp(p + 1, c, TRUE, NULL);
if (*p != c)
return NULL;
/* Truncate the pattern. */
if (s != NULL)
*p = NUL;
++p;
/* Find the flags */
while (*p == 'g' || *p == 'j') {
if (flags != NULL) {
if (*p == 'g')
*flags |= VGR_GLOBAL;
else
*flags |= VGR_NOJUMP;
}
++p;
}
}
return p;
}
/* /*
* Restore current working directory to "dirname_start" if they differ, taking * Restore current working directory to "dirname_start" if they differ, taking
* into account whether it is set locally or globally. * into account whether it is set locally or globally.

View File

@@ -205,7 +205,7 @@ static const int included_patches[] = {
2242, 2242,
2241, 2241,
2240, 2240,
// 2239, 2239,
// 2238 NA // 2238 NA
2237, 2237,
2236, 2236,