From cbdbc4f63d68a6b17b9eea5c67130e37d3d0f278 Mon Sep 17 00:00:00 2001 From: ZviRackover Date: Sun, 2 Sep 2018 00:58:30 +0300 Subject: Refactor: Remove occurences of mb_char2bytes --- src/nvim/ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/ops.c') diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 23948df769..fcfadbfd28 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -1739,7 +1739,7 @@ int op_replace(oparg_T *oap, int c) int newp_len = bd.textcol + bd.startspaces; if (has_mbyte) { while (--num_chars >= 0) { - newp_len += (*mb_char2bytes)(c, newp + newp_len); + newp_len += utf_char2bytes(c, newp + newp_len); } } else { memset(newp + newp_len, c, (size_t)numc); -- cgit From ac13e65ae0ce98516e816ba4fcf468d19e750c30 Mon Sep 17 00:00:00 2001 From: ZviRackover Date: Sun, 2 Sep 2018 01:36:18 +0300 Subject: Remove has_mbytes local to lines changed in parent commit --- src/nvim/ops.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/nvim/ops.c') diff --git a/src/nvim/ops.c b/src/nvim/ops.c index fcfadbfd28..d28e51ba4d 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -1737,13 +1737,8 @@ int op_replace(oparg_T *oap, int c) if (had_ctrl_v_cr || (c != '\r' && c != '\n')) { // strlen(newp) at this point int newp_len = bd.textcol + bd.startspaces; - if (has_mbyte) { - while (--num_chars >= 0) { - newp_len += utf_char2bytes(c, newp + newp_len); - } - } else { - memset(newp + newp_len, c, (size_t)numc); - newp_len += numc; + while (--num_chars >= 0) { + newp_len += utf_char2bytes(c, newp + newp_len); } if (!bd.is_short) { // insert post-spaces -- cgit