diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-07-21 17:06:00 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-07-21 17:06:00 +0200 |
commit | ac7c33e38c6e47a9568c1037e9ddd09d29c2a64e (patch) | |
tree | 5227002ee87a7cac4c342c612420833536f798f4 /src/regexp.c | |
parent | 9ba7e17de1b9ff6f443858036ac15624d86929aa (diff) | |
download | vim-git-ac7c33e38c6e47a9568c1037e9ddd09d29c2a64e.tar.gz |
updated for version 7.4a.036v7.4a.036
Problem: "\p" in a regexp does not match double-width characters.
(Yukihiro Nakadaira)
Solution: Don't count display cells, use vim_isprintc().
Diffstat (limited to 'src/regexp.c')
-rw-r--r-- | src/regexp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/regexp.c b/src/regexp.c index fdcd9f41e..06bbb4a54 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -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); } |