diff options
| author | Matias Linares <matiaslina@opmbx.org> | 2015-04-03 21:27:12 -0300 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-04-04 11:24:38 +0200 |
| commit | 481bcb1dcca2bd486cfb1e803349929e832eaa23 (patch) | |
| tree | 37fd783bfec2f6c469f0897b72653286c97f875d | |
| parent | 7f0ea7a559f6c1b79b554d8e1cf880f4d22c7a61 (diff) | |
| download | vis-481bcb1dcca2bd486cfb1e803349929e832eaa23.tar.gz vis-481bcb1dcca2bd486cfb1e803349929e832eaa23.tar.xz | |
Change behaviour of 'cw' and 'cW'
from vim's help:
cw cW
Special case: When the cursor is in a word, "cw" and "cW" do not include the
white space after a word, they only change up to the end of the word. This is
because Vim interprets "cw" as change-word, and a word does not include the
following white space.
| -rw-r--r-- | vis.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -956,6 +956,14 @@ static void movement(const Arg *arg) { action.textobj = moves_linewise[arg->i]; else action.movement = &moves[arg->i]; + + if (action.op == &ops[OP_CHANGE]) { + if (action.movement == &moves[MOVE_WORD_START_NEXT]) + action.movement = &moves[MOVE_WORD_END_NEXT]; + else if (action.movement == &moves[MOVE_LONGWORD_START_NEXT]) + action.movement = &moves[MOVE_LONGWORD_END_NEXT]; + } + action_do(&action); } |
