From 63ab994fba2f2e0878be734d20bf8d106ddab67c Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 1 Nov 2019 22:26:06 -0400 Subject: 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 --- src/nvim/ops.c | 1 + src/nvim/testdir/test_virtualedit.vim | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'src') 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 -- cgit