diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-11-14 17:43:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-14 17:43:21 +0100 |
commit | 2f37ffb71920d0b50f658108736a1465e1e5f280 (patch) | |
tree | 1971f1f0f146e16cc8d0f52c97e6b9a0c21f27c6 /src/nvim/mbyte.c | |
parent | ede00b29d175625479060c5c52e256ec6fc445c1 (diff) | |
parent | 1450a6f7534147e3d7252594cf06e2a1cc14b79b (diff) | |
download | rneovim-2f37ffb71920d0b50f658108736a1465e1e5f280.tar.gz rneovim-2f37ffb71920d0b50f658108736a1465e1e5f280.tar.bz2 rneovim-2f37ffb71920d0b50f658108736a1465e1e5f280.zip |
Merge pull request #16316 from bfredl/macroman
refactor(macros): delete multibyte macros which just are aliases
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r-- | src/nvim/mbyte.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index b10e33d0c2..12460646ed 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -762,7 +762,7 @@ int utfc_ptr2char(const char_u *p, int *pcc) // Only accept a composing char when the first char isn't illegal. if ((len > 1 || *p < 0x80) && p[len] >= 0x80 - && UTF_COMPOSINGLIKE(p, p + len)) { + && utf_composinglike(p, p + len)) { cc = utf_ptr2char(p + len); for (;; ) { pcc[i++] = cc; @@ -791,9 +791,6 @@ int utfc_ptr2char(const char_u *p, int *pcc) */ int utfc_ptr2char_len(const char_u *p, int *pcc, int maxlen) { -#define IS_COMPOSING(s1, s2, s3) \ - (i == 0 ? UTF_COMPOSINGLIKE((s1), (s2)) : utf_iscomposing((s3))) - assert(maxlen > 0); int i = 0; @@ -809,7 +806,7 @@ int utfc_ptr2char_len(const char_u *p, int *pcc, int maxlen) int len_cc = utf_ptr2len_len(p + len, maxlen - len); safe = len_cc > 1 && len_cc <= maxlen - len; if (!safe || (pcc[i] = utf_ptr2char(p + len)) < 0x80 - || !IS_COMPOSING(p, p + len, pcc[i])) { + || !(i == 0 ? utf_composinglike(p, p+len) : utf_iscomposing(pcc[i]))) { break; } len += len_cc; @@ -914,7 +911,7 @@ int utfc_ptr2len(const char_u *const p) // skip all of them (otherwise the cursor would get stuck). int prevlen = 0; for (;;) { - if (p[len] < 0x80 || !UTF_COMPOSINGLIKE(p + prevlen, p + len)) { + if (p[len] < 0x80 || !utf_composinglike(p + prevlen, p + len)) { return len; } @@ -964,14 +961,14 @@ int utfc_ptr2len_len(const char_u *p, int size) /* * Next character length should not go beyond size to ensure that - * UTF_COMPOSINGLIKE(...) does not read beyond size. + * utf_composinglike(...) does not read beyond size. */ len_next_char = utf_ptr2len_len(p + len, size - len); if (len_next_char > size - len) { break; } - if (!UTF_COMPOSINGLIKE(p + prevlen, p + len)) { + if (!utf_composinglike(p + prevlen, p + len)) { break; } |