aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/normal.c13
-rw-r--r--src/testdir/test69.in10
-rw-r--r--src/testdir/test69.ok3
-rw-r--r--src/version.c1
4 files changed, 24 insertions, 3 deletions
diff --git a/src/normal.c b/src/normal.c
index cafb73cac6..ca5a0d912a 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -62,7 +62,7 @@
static int resel_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */
static linenr_T resel_VIsual_line_count; /* number of lines */
static colnr_T resel_VIsual_vcol; /* nr of cols or end col */
-static int VIsual_mode_orig = NUL; /* type of Visual mode, that user entered */
+static int VIsual_mode_orig = NUL; /* saved Visual mode */
static int restart_VIsual_select = 0;
@@ -4804,8 +4804,15 @@ static void nv_left(cmdarg_T *cap)
if ( (cap->oap->op_type == OP_DELETE
|| cap->oap->op_type == OP_CHANGE)
&& !lineempty(curwin->w_cursor.lnum)) {
- if (*ml_get_cursor() != NUL)
- ++curwin->w_cursor.col;
+ char_u *cp = ml_get_cursor();
+
+ if (*cp != NUL) {
+ if (has_mbyte) {
+ curwin->w_cursor.col += (*mb_ptr2len)(cp);
+ } else {
+ curwin->w_cursor.col++;
+ }
+ }
cap->retval |= CA_NO_ADJ_OP_END;
}
continue;
diff --git a/src/testdir/test69.in b/src/testdir/test69.in
index f18ee37905..75317b4954 100644
--- a/src/testdir/test69.in
+++ b/src/testdir/test69.in
@@ -155,6 +155,16 @@ ra test
aab
STARTTEST
+:set whichwrap+=h
+/^x
+dh
+:set whichwrap-=h
+ENDTEST
+
+x
+
+STARTTEST
:let a = '.é.' " one char of two bytes
:let b = '.é.' " normal e with composing char
/^byteidx
diff --git a/src/testdir/test69.ok b/src/testdir/test69.ok
index 1ff82f26bc..41cd9d02c3 100644
--- a/src/testdir/test69.ok
+++ b/src/testdir/test69.ok
@@ -150,6 +150,9 @@ aaaa
aaa
+áx
+
+
byteidx
[0, 1, 3, 4, -1]
[0, 1, 4, 5, -1]
diff --git a/src/version.c b/src/version.c
index 1464965891..aff9580a25 100644
--- a/src/version.c
+++ b/src/version.c
@@ -202,6 +202,7 @@ static char *(features[]) = {
static int included_patches[] = {
// Add new patch number below this line
+ 187,
186,
//185,
184,