diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-01-25 20:22:54 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-01-25 20:22:54 +0100 |
commit | 767d8c1a1ae762ecf47297c168b8c23caf05d30a (patch) | |
tree | f82a875ec61f0491ae2df5d507230641fbf83fa6 /src | |
parent | 5aec481097278d7d4e6559d9db2b9c3b8aa0dd5d (diff) | |
download | vim-767d8c1a1ae762ecf47297c168b8c23caf05d30a.zip |
patch 7.4.1178
Problem: empty() doesn't work for the new special variables.
Solution: Make empty() work. (Damien)
Diffstat (limited to 'src')
-rw-r--r-- | src/eval.c | 4 | ||||
-rw-r--r-- | src/testdir/test_viml.vim | 5 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index d08269fc9..359956be1 100644 --- a/src/eval.c +++ b/src/eval.c @@ -10578,6 +10578,10 @@ f_empty(argvars, rettv) n = argvars[0].vval.v_dict == NULL || argvars[0].vval.v_dict->dv_hashtab.ht_used == 0; break; + case VAR_SPECIAL: + n = argvars[0].vval.v_number != VVAL_TRUE; + break; + default: EMSG2(_(e_intern2), "f_empty()"); n = 0; diff --git a/src/testdir/test_viml.vim b/src/testdir/test_viml.vim index f32331a61..6b2b6b988 100644 --- a/src/testdir/test_viml.vim +++ b/src/testdir/test_viml.vim @@ -987,6 +987,11 @@ func Test_type() call assert_equal(v:true, eval(string(v:true))) call assert_equal(v:none, eval(string(v:none))) call assert_equal(v:null, eval(string(v:null))) + + call assert_true(empty(v:false)) + call assert_false(empty(v:true)) + call assert_true(empty(v:null)) + call assert_true(empty(v:none)) endfunc "------------------------------------------------------------------------------- diff --git a/src/version.c b/src/version.c index 298372e83..0a0bc1d17 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1178, +/**/ 1177, /**/ 1176, |