]> granicus.if.org Git - vim/commitdiff
patch 8.1.2235: "C" with 'virtualedit' set does not include multi-byte char v8.1.2235
authorBram Moolenaar <Bram@vim.org>
Thu, 31 Oct 2019 02:21:25 +0000 (03:21 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 31 Oct 2019 02:21:25 +0000 (03:21 +0100)
Problem:    "C" with 'virtualedit' set does not include multi-byte char.
Solution:   Include the whole multi-byte char. (Nobuhiro Takasaki,
            closes #5152)

src/ops.c
src/testdir/test_virtualedit.vim
src/version.c

index 6a9fbba8163e49d3d0e61b65dcaa9a4793807665..42b0dcbf9d8e6e849928c0a1c3a2adec09f1a8c9 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -912,6 +912,8 @@ op_delete(oparg_T *oap)
                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 */
index 67adede8d794b2fa1549b170033ee09e080cfdb0..1e6b26a0572729a0ee3ef6378b94017fa7648a4b 100644 (file)
@@ -73,3 +73,12 @@ func Test_edit_CTRL_G()
   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
index 324f40d7074a36ca65e52d318728ca8d978c6177..e8e2806a178fe1cd7c513b75f20fba94242ca97e 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2235,
 /**/
     2234,
 /**/