Skip to content

Commit 1555000

Browse files
committed
patch 7.4.1228
Problem: copy() and deepcopy() fail with special variables. (Nikolai Pavlov) Solution: Make it work. Add a test. Closes #614.
1 parent 448a225 commit 1555000

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/eval.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21939,6 +21939,7 @@ item_copy(
2193921939
#endif
2194021940
case VAR_STRING:
2194121941
case VAR_FUNC:
21942+
case VAR_SPECIAL:
2194221943
copy_tv(from, to);
2194321944
break;
2194421945
case VAR_LIST:

src/testdir/test_viml.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,16 @@ func Test_type()
10011001
call assert_equal(v:none, eval(string(v:none)))
10021002
call assert_equal(v:null, eval(string(v:null)))
10031003

1004+
call assert_equal(v:false, copy(v:false))
1005+
call assert_equal(v:true, copy(v:true))
1006+
call assert_equal(v:none, copy(v:none))
1007+
call assert_equal(v:null, copy(v:null))
1008+
1009+
call assert_equal([v:false], deepcopy([v:false]))
1010+
call assert_equal([v:true], deepcopy([v:true]))
1011+
call assert_equal([v:none], deepcopy([v:none]))
1012+
call assert_equal([v:null], deepcopy([v:null]))
1013+
10041014
call assert_true(empty(v:false))
10051015
call assert_false(empty(v:true))
10061016
call assert_true(empty(v:null))

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,8 @@ static char *(features[]) =
742742

743743
static int included_patches[] =
744744
{ /* Add new patch number below this line */
745+
/**/
746+
1228,
745747
/**/
746748
1227,
747749
/**/

0 commit comments

Comments
 (0)