aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-08-28 23:43:04 +0200
committerJustin M. Keyes <justinkz@gmail.com>2018-08-28 23:43:04 +0200
commit461d46d8ace1b6950bf2733de9cb2b290453d86d (patch)
treea592acf9f95e8c60cc396f48ac4bf73656c0846c /src/nvim/ops.c
parent885ca3b7a60b79feb1d4c9e54265c8b543d4f245 (diff)
parenta2403a0ed9afdfaea7abb5555dbdf555b56eff9a (diff)
downloadrneovim-461d46d8ace1b6950bf2733de9cb2b290453d86d.tar.gz
rneovim-461d46d8ace1b6950bf2733de9cb2b290453d86d.tar.bz2
rneovim-461d46d8ace1b6950bf2733de9cb2b290453d86d.zip
Merge #8863 'refactor: Remove mb_head_off()'
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c15
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