]> granicus.if.org Git - vim/commitdiff
patch 7.4.1228 v7.4.1228
authorBram Moolenaar <Bram@vim.org>
Sun, 31 Jan 2016 17:45:24 +0000 (18:45 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 31 Jan 2016 17:45:24 +0000 (18:45 +0100)
Problem:    copy() and deepcopy() fail with special variables. (Nikolai
            Pavlov)
Solution:   Make it work.  Add a test.  Closes #614.

src/eval.c
src/testdir/test_viml.vim
src/version.c

index a4f5531d96509a4885b84669097df4994f0a0f8f..4c530a0bf2b2f3352bdc87cc87c64e25f65d0b00 100644 (file)
@@ -21939,6 +21939,7 @@ item_copy(
 #endif
        case VAR_STRING:
        case VAR_FUNC:
+       case VAR_SPECIAL:
            copy_tv(from, to);
            break;
        case VAR_LIST:
index f7b34146ac88a9fa79b545ecc465ec7d8d68a4ff..6c755bb534f3d899b016a860f2870f849d62907c 100644 (file)
@@ -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))
index 1130a20a2e3fa28a35dbc44170fb4ce3f26061fe..6eb8b240d87dfcffde0355ed8fd428147d1405f2 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1228,
 /**/
     1227,
 /**/