# HG changeset patch # User Christian Brabandt # Date 1454263204 -3600 # Node ID d4fec9208e7e2dfdf8d547e4078a0f46a30634b6 # Parent 868cb0895bdd597266c8091d3ab70f3730be803e commit https://github.com/vim/vim/commit/155500077c80cdb5d9c63996000c011b66a676bf Author: Bram Moolenaar Date: Sun Jan 31 18:45:24 2016 +0100 patch 7.4.1228 Problem: copy() and deepcopy() fail with special variables. (Nikolai Pavlov) Solution: Make it work. Add a test. Closes https://github.com/vim/vim/issues/614. diff --git a/src/eval.c b/src/eval.c --- a/src/eval.c +++ b/src/eval.c @@ -21939,6 +21939,7 @@ item_copy( #endif case VAR_STRING: case VAR_FUNC: + case VAR_SPECIAL: copy_tv(from, to); break; case VAR_LIST: diff --git a/src/testdir/test_viml.vim b/src/testdir/test_viml.vim --- a/src/testdir/test_viml.vim +++ b/src/testdir/test_viml.vim @@ -1001,6 +1001,16 @@ func Test_type() call assert_equal(v:none, eval(string(v:none))) call assert_equal(v:null, eval(string(v:null))) + call assert_equal(v:false, copy(v:false)) + call assert_equal(v:true, copy(v:true)) + call assert_equal(v:none, copy(v:none)) + call assert_equal(v:null, copy(v:null)) + + call assert_equal([v:false], deepcopy([v:false])) + call assert_equal([v:true], deepcopy([v:true])) + call assert_equal([v:none], deepcopy([v:none])) + call assert_equal([v:null], deepcopy([v:null])) + call assert_true(empty(v:false)) call assert_false(empty(v:true)) call assert_true(empty(v:null)) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1228, +/**/ 1227, /**/ 1226,