From ec02d9aad6b3015b1802476521a65234c70b0574 Mon Sep 17 00:00:00 2001 From: KunMing Xie Date: Wed, 21 Feb 2018 04:44:37 +0800 Subject: vim-patch:8.0.0222: blockwise put on multi-byte char (#8030) Note: code change was covered by c2a18216114bae75b6d6a2c7f1a68db04578abce Problem: When a multi-byte character ends in a zero byte, putting blockwise text puts it before the character instead of after it. Solution: Use int instead of char for the character under the cursor. (Luchr, closes vim/vim#1403) Add a test. https://github.com/vim/vim/commit/c81299684b2b9045e56525d3da3f45e8440fbf0d --- src/nvim/testdir/Makefile | 1 + src/nvim/testdir/test_alot.vim | 1 + src/nvim/testdir/test_put.vim | 12 ++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 src/nvim/testdir/test_put.vim diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 211ee974fb..418463a0ad 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -87,6 +87,7 @@ NEW_TESTS ?= \ test_number.res \ test_options.res \ test_profile.res \ + test_put.res \ test_quickfix.res \ test_recover.res \ test_retab.res \ diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index 9bf6df3251..b4baf7a8d7 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -24,6 +24,7 @@ source test_mapping.vim source test_messages.vim source test_partial.vim source test_popup.vim +source test_put.vim source test_recover.vim source test_regexp_utf8.vim source test_source_utf8.vim diff --git a/src/nvim/testdir/test_put.vim b/src/nvim/testdir/test_put.vim new file mode 100644 index 0000000000..612bdabb6c --- /dev/null +++ b/src/nvim/testdir/test_put.vim @@ -0,0 +1,12 @@ + +func Test_put_block() + if !has('multi_byte') + return + endif + new + call feedkeys("i\u2500\x\", 'x') + call feedkeys("\y", 'x') + call feedkeys("gg0p", 'x') + call assert_equal("\u2500x", getline(1)) + bwipe! +endfunc -- cgit