aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-11-01 22:26:06 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-11-01 22:29:48 -0400
commit63ab994fba2f2e0878be734d20bf8d106ddab67c (patch)
treeabe43e2976e7374f31ff7ec029b256f507d845cb
parent90981f5861e4c23c6a23a0082261b074ba48ea47 (diff)
downloadrneovim-63ab994fba2f2e0878be734d20bf8d106ddab67c.tar.gz
rneovim-63ab994fba2f2e0878be734d20bf8d106ddab67c.tar.bz2
rneovim-63ab994fba2f2e0878be734d20bf8d106ddab67c.zip
vim-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 vim/vim#5152) https://github.com/vim/vim/commit/77ccc00340ed2598f7aa09716217e878665964fa
-rw-r--r--src/nvim/ops.c1
-rw-r--r--src/nvim/testdir/test_virtualedit.vim9
2 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 030782cbcc..fbbdfdcd82 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -1562,6 +1562,7 @@ int op_delete(oparg_T *oap)
oap->end = curwin->w_cursor;
curwin->w_cursor = oap->start;
}
+ mb_adjust_opend(oap);
}
if (oap->line_count == 1) { /* delete characters within one line */
diff --git a/src/nvim/testdir/test_virtualedit.vim b/src/nvim/testdir/test_virtualedit.vim
index 67adede8d7..1e6b26a057 100644
--- a/src/nvim/testdir/test_virtualedit.vim
+++ b/src/nvim/testdir/test_virtualedit.vim
@@ -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