0
0
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:
Bram Moolenaar
2018-12-27 23:44:44 +01:00
parent d385b5d329
commit 5976f8ff00
6 changed files with 73 additions and 3 deletions

View File

@@ -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;
}