aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/normal.c6
-rw-r--r--src/nvim/option_defs.h7
2 files changed, 8 insertions, 5 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 92b1cf2d55..d010b4b3a7 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -7193,8 +7193,10 @@ static void nv_wordcmd(cmdarg_T *cap)
// 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;
+ if (vim_strchr(p_cpo, CPO_CHANGEW) != NULL) {
+ cap->oap->inclusive = true;
+ word_end = true;
+ }
flag = true;
}
}
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index 9c6393e014..1fd6dc9c91 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -129,9 +129,10 @@
#define CPO_REGAPPEND '>' /* insert NL when appending to a register */
#define CPO_SCOLON ';' /* using "," and ";" will skip over char if
* cursor would not move */
-/* default values for Vim and Vi */
-#define CPO_VIM "aABceFs"
-#define CPO_VI "aAbBcCdDeEfFiIJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>;"
+#define CPO_CHANGEW '_' // "cw" special-case
+// default values for Vim and Vi
+#define CPO_VIM "aABceFs_"
+#define CPO_VI "aAbBcCdDeEfFiIJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>;_"
/* characters for p_ww option: */
#define WW_ALL "bshl<>[],~"