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

updated for version 7.3.796

Problem:    "/[^\n]" does match at a line break.
Solution:   Make it do the same as "/.". (Christian Brabandt)
This commit is contained in:
Bram Moolenaar
2013-01-30 18:21:51 +01:00
parent d214221375
commit e337e5f634
4 changed files with 9 additions and 4 deletions

View File

@@ -2397,13 +2397,15 @@ collection:
/* '\n' in range: also match NL */ /* '\n' in range: also match NL */
if (ret != JUST_CALC_SIZE) if (ret != JUST_CALC_SIZE)
{ {
if (*ret == ANYBUT) /* Using \n inside [^] does not change what
*ret = ANYBUT + ADD_NL; * matches. "[^\n]" is the same as ".". */
else if (*ret == ANYOF) if (*ret == ANYOF)
{
*ret = ANYOF + ADD_NL; *ret = ANYOF + ADD_NL;
*flagp |= HASNL;
}
/* else: must have had a \n already */ /* else: must have had a \n already */
} }
*flagp |= HASNL;
regparse++; regparse++;
startc = -1; startc = -1;
} }
@@ -4344,6 +4346,7 @@ regmatch(scan)
break; /* Matched with EOW */ break; /* Matched with EOW */
case ANY: case ANY:
/* ANY does not match new lines. */
if (c == NUL) if (c == NUL)
status = RA_NOMATCH; status = RA_NOMATCH;
else else

Binary file not shown.

Binary file not shown.

View File

@@ -725,6 +725,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 */
/**/
796,
/**/ /**/
795, 795,
/**/ /**/