patch 8.1.2235: "C" with 'virtualedit' set does not include multi-byte char
Problem: "C" with 'virtualedit' set does not include multi-byte char.
Solution: Include the whole multi-byte char. (Nobuhiro Takasaki,
closes #5152)
diff --git a/src/ops.c b/src/ops.c
index 6a9fbba..42b0dcb 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -912,6 +912,8 @@
oap->end = curwin->w_cursor;
curwin->w_cursor = oap->start;
}
+ if (has_mbyte)
+ mb_adjust_opend(oap);
}
if (oap->line_count == 1) /* delete characters within one line */
diff --git a/src/testdir/test_virtualedit.vim b/src/testdir/test_virtualedit.vim
index 67adede..1e6b26a0 100644
--- a/src/testdir/test_virtualedit.vim
+++ b/src/testdir/test_virtualedit.vim
@@ -73,3 +73,12 @@
bwipe!
set virtualedit=
endfunc
+
+func Test_edit_change()
+ new
+ set virtualedit=all
+ call setline(1, "\t⒌")
+ normal Cx
+ call assert_equal('x', getline(1))
+ bwipe!
+endfunc
diff --git a/src/version.c b/src/version.c
index 324f40d..e8e2806 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2235,
+/**/
2234,
/**/
2233,