diff options
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r-- | src/nvim/ops.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 9ffd934d44..23948df769 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -520,12 +520,12 @@ static void block_insert(oparg_T *oap, char_u *s, int b_insert, struct block_def } } - if (has_mbyte && spaces > 0) { + if (spaces > 0) { int off; // Avoid starting halfway through a multi-byte character. if (b_insert) { - off = (*mb_head_off)(oldp, oldp + offset + spaces); + off = utf_head_off(oldp, oldp + offset + spaces); } else { off = (*mb_off_next)(oldp, oldp + offset); offset += off; @@ -2460,11 +2460,10 @@ static void op_yank_reg(oparg_T *oap, bool message, yankreg_T *reg, bool append) if (virtual_op) { getvcol(curwin, &oap->end, &cs, NULL, &ce); if (p[endcol] == NUL || (cs + oap->end.coladd < ce - /* Don't add space for double-wide - * char; endcol will be on last byte - * of multi-byte char. */ - && (*mb_head_off)(p, p + endcol) == 0 - )) { + // Don't add space for double-wide + // char; endcol will be on last byte + // of multi-byte char. + && utf_head_off(p, p + endcol) == 0)) { if (oap->start.lnum == oap->end.lnum && oap->start.col == oap->end.col) { /* Special case: inside a single char */ @@ -3021,7 +3020,7 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags) bd.startspaces = incr - bd.endspaces; --bd.textcol; delcount = 1; - bd.textcol -= (*mb_head_off)(oldp, oldp + bd.textcol); + bd.textcol -= utf_head_off(oldp, oldp + bd.textcol); if (oldp[bd.textcol] != TAB) { /* Only a Tab can be split into spaces. Other * characters will have to be moved to after the |