Merge pull request #4310 from jbradaric/vim-7.4.939

vim-patch:7.4.939
This commit is contained in:
Justin M. Keyes
2016-02-22 00:48:54 -05:00
2 changed files with 24 additions and 21 deletions

View File

@@ -9362,11 +9362,9 @@ static void ex_nohlsearch(exarg_T *eap)
redraw_all_later(SOME_VALID); redraw_all_later(SOME_VALID);
} }
/* // ":[N]match {group} {pattern}"
* ":[N]match {group} {pattern}" // Sets nextcmd to the start of the next command, if any. Also called when
* Sets nextcmd to the start of the next command, if any. Also called when // skipping commands to find the next command.
* skipping commands to find the next command.
*/
static void ex_match(exarg_T *eap) static void ex_match(exarg_T *eap)
{ {
char_u *p; char_u *p;
@@ -9375,39 +9373,44 @@ static void ex_match(exarg_T *eap)
int c; int c;
int id; int id;
if (eap->line2 <= 3) if (eap->line2 <= 3) {
id = eap->line2; id = eap->line2;
else { } else {
EMSG(e_invcmd); EMSG(e_invcmd);
return; return;
} }
/* First clear any old pattern. */ // First clear any old pattern.
if (!eap->skip) if (!eap->skip) {
match_delete(curwin, id, FALSE); match_delete(curwin, id, false);
}
if (ends_excmd(*eap->arg)) if (ends_excmd(*eap->arg)) {
end = eap->arg; end = eap->arg;
else if ((STRNICMP(eap->arg, "none", 4) == 0 } else if ((STRNICMP(eap->arg, "none", 4) == 0
&& (ascii_iswhite(eap->arg[4]) || ends_excmd(eap->arg[4])))) && (ascii_iswhite(eap->arg[4]) || ends_excmd(eap->arg[4])))) {
end = eap->arg + 4; end = eap->arg + 4;
else { } else {
p = skiptowhite(eap->arg); p = skiptowhite(eap->arg);
if (!eap->skip) if (!eap->skip) {
g = vim_strnsave(eap->arg, (int)(p - eap->arg)); g = vim_strnsave(eap->arg, (int)(p - eap->arg));
}
p = skipwhite(p); p = skipwhite(p);
if (*p == NUL) { if (*p == NUL) {
/* There must be two arguments. */ // There must be two arguments.
xfree(g);
EMSG2(_(e_invarg2), eap->arg); EMSG2(_(e_invarg2), eap->arg);
return; return;
} }
end = skip_regexp(p + 1, *p, TRUE, NULL); end = skip_regexp(p + 1, *p, true, NULL);
if (!eap->skip) { if (!eap->skip) {
if (*end != NUL && !ends_excmd(*skipwhite(end + 1))) { if (*end != NUL && !ends_excmd(*skipwhite(end + 1))) {
xfree(g);
eap->errmsg = e_trailing; eap->errmsg = e_trailing;
return; return;
} }
if (*end != *p) { if (*end != *p) {
xfree(g);
EMSG2(_(e_invarg2), p); EMSG2(_(e_invarg2), p);
return; return;
} }

View File

@@ -351,7 +351,7 @@ static int included_patches[] = {
// 942, // 942,
// 941, // 941,
// 940 NA // 940 NA
// 939, 939,
// 938 NA // 938 NA
// 937, // 937,
// 936, // 936,