Mercurial > vim
changeset 7740:00fc76e6bd99 v7.4.1168
commit https://github.com/vim/vim/commit/f48aa160fdd7b8caa7678e1a2139244dd2bdc547
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 24 17:54:24 2016 +0100
patch 7.4.1168
Problem: This doesn't give the right result: eval(string(v:true)). (Nikolay
Pavlov)
Solution: Make the string "v:true" instead of "true".
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 24 Jan 2016 18:00:06 +0100 |
parents | d0f70a9fdb72 |
children | 74b54a066bff |
files | src/eval.c src/testdir/test_viml.vim src/version.c |
diffstat | 3 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -7825,10 +7825,10 @@ get_var_special_name(int nr) { switch (nr) { - case VVAL_FALSE: return "false"; - case VVAL_TRUE: return "true"; - case VVAL_NONE: return "none"; - case VVAL_NULL: return "null"; + case VVAL_FALSE: return "v:false"; + case VVAL_TRUE: return "v:true"; + case VVAL_NONE: return "v:none"; + case VVAL_NULL: return "v:null"; } EMSG2(_(e_intern2), "get_var_special_name()"); return "42";
--- a/src/testdir/test_viml.vim +++ b/src/testdir/test_viml.vim @@ -942,10 +942,10 @@ func Test_type() call assert_equal(0, 0 + v:none) call assert_equal(0, 0 + v:null) - call assert_equal('false', '' . v:false) - call assert_equal('true', '' . v:true) - call assert_equal('none', '' . v:none) - call assert_equal('null', '' . v:null) + call assert_equal('v:false', '' . v:false) + call assert_equal('v:true', '' . v:true) + call assert_equal('v:none', '' . v:none) + call assert_equal('v:null', '' . v:null) call assert_true(v:false == 0) call assert_false(v:false != 0)