diff options
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r-- | src/nvim/regexp.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index c4af7d9e4a..ef02b6529c 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -4246,26 +4246,28 @@ regmatch ( int opndc = 0, inpc; opnd = OPERAND(scan); - /* Safety check (just in case 'encoding' was changed since - * compiling the program). */ + // Safety check (just in case 'encoding' was changed since + // compiling the program). if ((len = (*mb_ptr2len)(opnd)) < 2) { status = RA_NOMATCH; break; } - if (enc_utf8) - opndc = mb_ptr2char(opnd); + if (enc_utf8) { + opndc = utf_ptr2char(opnd); + } if (enc_utf8 && utf_iscomposing(opndc)) { /* When only a composing char is given match at any * position where that composing char appears. */ status = RA_NOMATCH; for (i = 0; reginput[i] != NUL; i += utf_ptr2len(reginput + i)) { - inpc = mb_ptr2char(reginput + i); + inpc = utf_ptr2char(reginput + i); if (!utf_iscomposing(inpc)) { - if (i > 0) + if (i > 0) { break; + } } else if (opndc == inpc) { - /* Include all following composing chars. */ - len = i + mb_ptr2len(reginput + i); + // Include all following composing chars. + len = i + utfc_ptr2len(reginput + i); status = RA_MATCH; break; } |