diff options
author | Matthieu Coudron <mattator@gmail.com> | 2020-11-15 18:18:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-15 18:18:12 +0100 |
commit | 1b8867ab39ecc25d454ca67e3cb8b3ef5fca9ed3 (patch) | |
tree | 1c169437d934d30564b42127b11e888fde04a2fd /src/nvim/change.c | |
parent | bcadf324cb6516369cb89da9bb1e8056f6fb91bb (diff) | |
parent | 87aaa8e837d873577ee6a908a387f40e3548bcb6 (diff) | |
download | rneovim-1b8867ab39ecc25d454ca67e3cb8b3ef5fca9ed3.tar.gz rneovim-1b8867ab39ecc25d454ca67e3cb8b3ef5fca9ed3.tar.bz2 rneovim-1b8867ab39ecc25d454ca67e3cb8b3ef5fca9ed3.zip |
Merge pull request #13293 from janlazo/vim-8.2.1976
vim-patch:8.2.{1979,1981,1982,1985,1987}
Diffstat (limited to 'src/nvim/change.c')
-rw-r--r-- | src/nvim/change.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c index 271d350967..0f5081c94c 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -530,12 +530,8 @@ void ins_bytes_len(char_u *p, size_t len) { size_t n; for (size_t i = 0; i < len; i += n) { - if (enc_utf8) { - // avoid reading past p[len] - n = (size_t)utfc_ptr2len_len(p + i, (int)(len - i)); - } else { - n = (size_t)(*mb_ptr2len)(p + i); - } + // avoid reading past p[len] + n = (size_t)utfc_ptr2len_len(p + i, (int)(len - i)); ins_char_bytes(p + i, n); } } @@ -761,7 +757,7 @@ int del_bytes(colnr_T count, bool fixpos_arg, bool use_delcombine) // If 'delcombine' is set and deleting (less than) one character, only // delete the last combining character. - if (p_deco && use_delcombine && enc_utf8 + if (p_deco && use_delcombine && utfc_ptr2len(oldp + col) >= count) { int cc[MAX_MCO]; int n; |