Mercurial > vim
comparison src/normal.c @ 15279:54457fc4af0b v8.1.0648
patch 8.1.0648: custom operators can't act upon a forced motion
commit https://github.com/vim/vim/commit/5976f8ff00efcb3e155a89346e44f2ad43d2405a
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Dec 27 23:44:44 2018 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 27 Dec 2018 23:45:05 +0100 |
parents | db5d2429bda3 |
children | 15e6f35b4223 |
comparison
equal
deleted
inserted
replaced
15278:772ad94a4e03 | 15279:54457fc4af0b |
---|---|
1393 oap->motion_type = MCHAR; | 1393 oap->motion_type = MCHAR; |
1394 } | 1394 } |
1395 else if (oap->motion_force == Ctrl_V) | 1395 else if (oap->motion_force == Ctrl_V) |
1396 { | 1396 { |
1397 /* Change line- or characterwise motion into Visual block mode. */ | 1397 /* Change line- or characterwise motion into Visual block mode. */ |
1398 VIsual_active = TRUE; | 1398 if (!VIsual_active) |
1399 VIsual = oap->start; | 1399 { |
1400 VIsual_active = TRUE; | |
1401 VIsual = oap->start; | |
1402 } | |
1400 VIsual_mode = Ctrl_V; | 1403 VIsual_mode = Ctrl_V; |
1401 VIsual_select = FALSE; | 1404 VIsual_select = FALSE; |
1402 VIsual_reselect = FALSE; | 1405 VIsual_reselect = FALSE; |
1403 } | 1406 } |
1404 | 1407 |
2127 { | 2130 { |
2128 curwin->w_cursor = old_cursor; | 2131 curwin->w_cursor = old_cursor; |
2129 } | 2132 } |
2130 oap->block_mode = FALSE; | 2133 oap->block_mode = FALSE; |
2131 clearop(oap); | 2134 clearop(oap); |
2135 motion_force = NUL; | |
2132 } | 2136 } |
2133 #ifdef FEAT_LINEBREAK | 2137 #ifdef FEAT_LINEBREAK |
2134 curwin->w_p_lbr = lbr_saved; | 2138 curwin->w_p_lbr = lbr_saved; |
2135 #endif | 2139 #endif |
2136 } | 2140 } |
7687 | 7691 |
7688 /* 'v', 'V' and CTRL-V can be used while an operator is pending to make it | 7692 /* 'v', 'V' and CTRL-V can be used while an operator is pending to make it |
7689 * characterwise, linewise, or blockwise. */ | 7693 * characterwise, linewise, or blockwise. */ |
7690 if (cap->oap->op_type != OP_NOP) | 7694 if (cap->oap->op_type != OP_NOP) |
7691 { | 7695 { |
7692 cap->oap->motion_force = cap->cmdchar; | 7696 motion_force = cap->oap->motion_force = cap->cmdchar; |
7693 finish_op = FALSE; /* operator doesn't finish now but later */ | 7697 finish_op = FALSE; /* operator doesn't finish now but later */ |
7694 return; | 7698 return; |
7695 } | 7699 } |
7696 | 7700 |
7697 VIsual_select = cap->arg; | 7701 VIsual_select = cap->arg; |