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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user