summaryrefslogtreecommitdiff
path: root/src/normal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-12-27 23:44:44 +0100
committerBram Moolenaar <Bram@vim.org>2018-12-27 23:44:44 +0100
commit5976f8ff00efcb3e155a89346e44f2ad43d2405a (patch)
tree31bff7f7afdc7884dbcee07406e6c575784c16b5 /src/normal.c
parentd385b5d329a6a98539fa21cfb60ed632cd03d544 (diff)
downloadvim-git-5976f8ff00efcb3e155a89346e44f2ad43d2405a.tar.gz
patch 8.1.0648: custom operators can't act upon a forced motionv8.1.0648
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)
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/normal.c b/src/normal.c
index 78e3f201c..77191c67e 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1395,8 +1395,11 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
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 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
}
oap->block_mode = FALSE;
clearop(oap);
+ motion_force = NUL;
}
#ifdef FEAT_LINEBREAK
curwin->w_p_lbr = lbr_saved;
@@ -7689,7 +7693,7 @@ nv_visual(cmdarg_T *cap)
* 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;
}