vim-patch:7.4.360

Problem:    In a regexp pattern a "$" followed by \v or \V is not seen as the
            end-of-line.
Solution:   Handle the situation. (Ozaki Kiichi)

https://code.google.com/p/vim/source/detail?r=v7-4-360
This commit is contained in:
André Twupack 2014-09-21 01:02:22 +02:00
parent 0ed9f3ec83
commit e1517d4f53
2 changed files with 16 additions and 4 deletions

View File

@ -2790,17 +2790,29 @@ static int peekchr(void)
* either "\|", "\)", "\&", or "\n" */ * either "\|", "\)", "\&", or "\n" */
if (reg_magic >= MAGIC_OFF) { if (reg_magic >= MAGIC_OFF) {
char_u *p = regparse + 1; char_u *p = regparse + 1;
bool is_magic_all = (reg_magic == MAGIC_ALL);
/* ignore \c \C \m and \M after '$' */ // ignore \c \C \m \M \v \V and \Z after '$'
while (p[0] == '\\' && (p[1] == 'c' || p[1] == 'C' while (p[0] == '\\' && (p[1] == 'c' || p[1] == 'C'
|| p[1] == 'm' || p[1] == 'M' || p[1] == 'Z')) || p[1] == 'm' || p[1] == 'M'
|| p[1] == 'v' || p[1] == 'V'
|| p[1] == 'Z')) {
if (p[1] == 'v') {
is_magic_all = true;
} else if (p[1] == 'm' || p[1] == 'M' || p[1] == 'V') {
is_magic_all = false;
}
p += 2; p += 2;
}
if (p[0] == NUL if (p[0] == NUL
|| (p[0] == '\\' || (p[0] == '\\'
&& (p[1] == '|' || p[1] == '&' || p[1] == ')' && (p[1] == '|' || p[1] == '&' || p[1] == ')'
|| p[1] == 'n')) || p[1] == 'n'))
|| reg_magic == MAGIC_ALL) || (is_magic_all
&& (p[0] == '|' || p[0] == '&' || p[0] == ')'))
|| reg_magic == MAGIC_ALL) {
curchr = Magic('$'); curchr = Magic('$');
}
} }
break; break;
case '\\': case '\\':

View File

@ -268,7 +268,7 @@ static int included_patches[] = {
//363, //363,
362, 362,
361, 361,
//360, 360,
359, 359,
358, 358,
357, 357,