diff options
author | James McCoy <jamessan@jamessan.com> | 2017-02-10 09:29:27 -0500 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-02-10 09:42:42 -0500 |
commit | 3677189bfc1978b3b55f70d75d93bae54fa1f704 (patch) | |
tree | 558c345b2c0bbd71f37e405c0398d6882c24854f | |
parent | 91efe96b9661369add378499fd4fc918f624d9a9 (diff) | |
download | rneovim-3677189bfc1978b3b55f70d75d93bae54fa1f704.tar.gz rneovim-3677189bfc1978b3b55f70d75d93bae54fa1f704.tar.bz2 rneovim-3677189bfc1978b3b55f70d75d93bae54fa1f704.zip |
vim-patch:7.4.1954
Problem: No test for what 7.4.1948 fixes.
Solution: Add a test. (Hirohito Higashi, closes vim/vim#880)
https://github.com/vim/vim/commit/d388d2ac8bf8c770bf97dc406e99a20ba5104855
Some adjustments had to be made from upstream since nvim always uses
utf-8 internally.
* Removed the 'set encoding=cp932' line from the test
* Adjusted the expected values for getpos(), since the number of bytes
is different in utf-8
-rw-r--r-- | src/nvim/testdir/Makefile | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_increment_dbcs.vim | 29 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
3 files changed, 31 insertions, 1 deletions
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 59c93f1673..bca18adef8 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -37,6 +37,7 @@ NEW_TESTS = \ test_hardcopy.res \ test_help_tagjump.res \ test_history.res \ + test_increment_dbcs.res \ test_langmap.res \ test_match.res \ test_matchadd_conceal.res \ diff --git a/src/nvim/testdir/test_increment_dbcs.vim b/src/nvim/testdir/test_increment_dbcs.vim new file mode 100644 index 0000000000..ee286a0a24 --- /dev/null +++ b/src/nvim/testdir/test_increment_dbcs.vim @@ -0,0 +1,29 @@ +" Tests for using Ctrl-A/Ctrl-X using DBCS. +if !has('multi_byte') + finish +endif +scriptencoding cp932 + +func SetUp() + new + set nrformats& +endfunc + +func TearDown() + bwipe! +endfunc + +func Test_increment_dbcs_1() + set nrformats+=alpha + call setline(1, ["ŽR1"]) + exec "norm! 0\<C-A>" + call assert_equal(["ŽR2"], getline(1, '$')) + call assert_equal([0, 1, 4, 0], getpos('.')) + + call setline(1, ["‚`‚a‚b0xDE‚e"]) + exec "norm! 0\<C-X>" + call assert_equal(["‚`‚a‚b0xDD‚e"], getline(1, '$')) + call assert_equal([0, 1, 13, 0], getpos('.')) +endfunc + +" vim: shiftwidth=2 expandtab diff --git a/src/nvim/version.c b/src/nvim/version.c index a958ff1fd9..d62ecc22cf 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -486,7 +486,7 @@ static int included_patches[] = { // 1957 NA 1956, // 1955 NA - // 1954, + 1954, 1953, 1952, // 1951 NA |