diff options
author | David Bürgin <676c7473@gmail.com> | 2015-04-25 18:07:24 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-04-27 01:08:17 -0400 |
commit | 4230f8c332ce56ed2369f1500f7eaceb0bd968f3 (patch) | |
tree | 7f5d5dea711d64f0395ed608c748e71db775957d /src/nvim/normal.c | |
parent | b85db92d7f88aa9636bdc5b49d0f4d7d50eba389 (diff) | |
download | rneovim-4230f8c332ce56ed2369f1500f7eaceb0bd968f3.tar.gz rneovim-4230f8c332ce56ed2369f1500f7eaceb0bd968f3.tar.bz2 rneovim-4230f8c332ce56ed2369f1500f7eaceb0bd968f3.zip |
'cpoptions': Remove "w" flag #2507
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index b122b3e1d5..b7f2666968 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -6714,35 +6714,18 @@ static void nv_wordcmd(cmdarg_T *cap) */ if (!word_end && cap->oap->op_type == OP_CHANGE) { n = gchar_cursor(); - if (n != NUL) { /* not an empty line */ - if (ascii_iswhite(n)) { - /* - * Reproduce a funny Vi behaviour: "cw" on a blank only - * changes one character, not all blanks until the start of - * the next word. Only do this when the 'w' flag is included - * in 'cpoptions'. - */ - if (cap->count1 == 1 && vim_strchr(p_cpo, CPO_CW) != NULL) { - cap->oap->inclusive = true; - cap->oap->motion_type = MCHAR; - return; - } - } else { - /* - * This is a little strange. To match what the real Vi does, - * we effectively map 'cw' to 'ce', and 'cW' to 'cE', provided - * that we are not on a space or a TAB. This seems impolite - * at first, but it's really more what we mean when we say - * 'cw'. - * Another strangeness: When standing on the end of a word - * "ce" will change until the end of the next word, but "cw" - * will change only one character! This is done by setting - * flag. - */ - cap->oap->inclusive = true; - word_end = true; - flag = true; - } + if (n != NUL && !ascii_iswhite(n)) { + // This is a little strange. To match what the real Vi does, we + // effectively map "cw" to "ce", and "cW" to "cE", provided that we are + // not on a space or a TAB. This seems impolite at first, but it's + // really more what we mean when we say "cw". + // + // Another strangeness: When standing on the end of a word "ce" will + // change until the end of the next word, but "cw" will change only one + // character! This is done by setting "flag". + cap->oap->inclusive = true; + word_end = true; + flag = true; } } |