patch 8.1.0648: custom operators can't act upon a forced motion
Problem: Custom operators can't act upon a forced motion. (Christian
Wellenbrock)
Solution: Add the forced motion to the mode() result. (Christian Brabandt,
closes #3490)
diff --git a/src/normal.c b/src/normal.c
index 78e3f20..77191c6 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1395,8 +1395,11 @@
else if (oap->motion_force == Ctrl_V)
{
/* Change line- or characterwise motion into Visual block mode. */
- VIsual_active = TRUE;
- VIsual = oap->start;
+ if (!VIsual_active)
+ {
+ VIsual_active = TRUE;
+ VIsual = oap->start;
+ }
VIsual_mode = Ctrl_V;
VIsual_select = FALSE;
VIsual_reselect = FALSE;
@@ -2129,6 +2132,7 @@
}
oap->block_mode = FALSE;
clearop(oap);
+ motion_force = NUL;
}
#ifdef FEAT_LINEBREAK
curwin->w_p_lbr = lbr_saved;
@@ -7689,7 +7693,7 @@
* characterwise, linewise, or blockwise. */
if (cap->oap->op_type != OP_NOP)
{
- cap->oap->motion_force = cap->cmdchar;
+ motion_force = cap->oap->motion_force = cap->cmdchar;
finish_op = FALSE; /* operator doesn't finish now but later */
return;
}