diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-08-15 08:31:13 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-08-15 08:31:13 -0400 |
commit | 6675a71fe4adb0ea21c842c6bba5e950d05a5f2c (patch) | |
tree | c146ed8ec2af0a06cc608b064c1e557ff432a5ea /src/nvim/regexp.c | |
parent | 6d4530979745aae216909f066c930893bbfbae81 (diff) | |
parent | 01d6898638851d01f6cb5812f1d6f64cda0ddc83 (diff) | |
download | rneovim-6675a71fe4adb0ea21c842c6bba5e950d05a5f2c.tar.gz rneovim-6675a71fe4adb0ea21c842c6bba5e950d05a5f2c.tar.bz2 rneovim-6675a71fe4adb0ea21c842c6bba5e950d05a5f2c.zip |
Merge pull request #972 from munshkr/p7.4.293
vim-patch:7.4.293, vim-patch:7.4.294
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r-- | src/nvim/regexp.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index ba7e4eb2d3..193c68860d 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -258,6 +258,7 @@ #define RE_MARK 207 /* mark cmp Match mark position */ #define RE_VISUAL 208 /* Match Visual area */ +#define RE_COMPOSING 209 // any composing characters /* * Magic characters have a special meaning, they don't match literally. @@ -2024,6 +2025,10 @@ static char_u *regatom(int *flagp) ret = regnode(RE_VISUAL); break; + case 'C': + ret = regnode(RE_COMPOSING); + break; + /* \%[abc]: Emit as a list of branches, all ending at the last * branch which matches nothing. */ case '[': @@ -4099,10 +4104,12 @@ regmatch ( status = RA_NOMATCH; } } - // Check for following composing character. + // Check for following composing character, unless %C + // follows (skips over all composing chars). if (status != RA_NOMATCH && enc_utf8 && UTF_COMPOSINGLIKE(reginput, reginput + len) - && !ireg_icombine) { + && !ireg_icombine + && OP(next) != RE_COMPOSING) { // raaron: This code makes a composing character get // ignored, which is the correct behavior (sometimes) // for voweled Hebrew texts. @@ -4167,6 +4174,15 @@ regmatch ( status = RA_NOMATCH; break; + case RE_COMPOSING: + if (enc_utf8) { + // Skip composing characters. + while (utf_iscomposing(utf_ptr2char(reginput))) { + mb_cptr_adv(reginput); + } + } + break; + case NOTHING: break; |