int t = getviscol2(curbuf->b_op_start_orig.col,
curbuf->b_op_start_orig.coladd);
- if (!bd.is_MAX)
- {
- if (oap->op_type == OP_INSERT
- && oap->start.col + oap->start.coladd
- != curbuf->b_op_start_orig.col
+ if (oap->op_type == OP_INSERT
+ && oap->start.col + oap->start.coladd
+ != curbuf->b_op_start_orig.col
+ curbuf->b_op_start_orig.coladd)
- {
- oap->start.col = curbuf->b_op_start_orig.col;
- pre_textlen -= t - oap->start_vcol;
- oap->start_vcol = t;
- }
- else if (oap->op_type == OP_APPEND
- && oap->start.col + oap->start.coladd
- >= curbuf->b_op_start_orig.col
- + curbuf->b_op_start_orig.coladd)
- {
- oap->start.col = curbuf->b_op_start_orig.col;
- // reset pre_textlen to the value of OP_INSERT
- pre_textlen += bd.textlen;
- pre_textlen -= t - oap->start_vcol;
- oap->start_vcol = t;
- oap->op_type = OP_INSERT;
- }
+ {
+ oap->start.col = curbuf->b_op_start_orig.col;
+ pre_textlen -= t - oap->start_vcol;
+ oap->start_vcol = t;
}
- else if (bd.is_MAX && oap->op_type == OP_APPEND)
+ else if (oap->op_type == OP_APPEND
+ && oap->start.col + oap->start.coladd
+ >= curbuf->b_op_start_orig.col
+ + curbuf->b_op_start_orig.coladd)
{
+ oap->start.col = curbuf->b_op_start_orig.col;
// reset pre_textlen to the value of OP_INSERT
pre_textlen += bd.textlen;
pre_textlen -= t - oap->start_vcol;
+ oap->start_vcol = t;
+ oap->op_type = OP_INSERT;
}
}