0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 7.4.1228

Problem:    copy() and deepcopy() fail with special variables. (Nikolai
            Pavlov)
Solution:   Make it work.  Add a test.  Closes #614.
This commit is contained in:
Bram Moolenaar
2016-01-31 18:45:24 +01:00
parent 448a22549b
commit 155500077c
3 changed files with 13 additions and 0 deletions

View 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:

View 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))

View File

@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1228,
/**/
1227,
/**/