1
0
forked from aniani/vim

updated for version 7.4a.036

Problem:    "\p" in a regexp does not match double-width characters.
            (Yukihiro Nakadaira)
Solution:   Don't count display cells, use vim_isprintc().
This commit is contained in:
Bram Moolenaar
2013-07-21 17:06:00 +02:00
parent 9ba7e17de1
commit ac7c33e38c
7 changed files with 30 additions and 5 deletions

View File

@@ -4563,14 +4563,14 @@ regmatch(scan)
break;
case PRINT:
if (ptr2cells(reginput) != 1)
if (!vim_isprintc(PTR2CHAR(reginput)))
status = RA_NOMATCH;
else
ADVANCE_REGINPUT();
break;
case SPRINT:
if (VIM_ISDIGIT(*reginput) || ptr2cells(reginput) != 1)
if (VIM_ISDIGIT(*reginput) || !vim_isprintc(PTR2CHAR(reginput)))
status = RA_NOMATCH;
else
ADVANCE_REGINPUT();
@@ -5944,7 +5944,8 @@ regrepeat(p, maxcount)
if (got_int)
break;
}
else if (ptr2cells(scan) == 1 && (testval || !VIM_ISDIGIT(*scan)))
else if (vim_isprintc(PTR2CHAR(scan)) == 1
&& (testval || !VIM_ISDIGIT(*scan)))
{
mb_ptr_adv(scan);
}