mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
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)
This commit is contained in:
10
src/normal.c
10
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user