mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 13:58:18 +00:00
Merge #8863 'refactor: Remove mb_head_off() '
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user