# HG changeset patch # User Christian Brabandt # Date 1453750205 -3600 # Node ID db58646580248c1fb8f2c9342aaa8ad9d4a08e7e # Parent 999cdc9f60101accba2e61494c1459299aa834da commit https://github.com/vim/vim/commit/767d8c1a1ae762ecf47297c168b8c23caf05d30a Author: Bram Moolenaar Date: Mon Jan 25 20:22:54 2016 +0100 patch 7.4.1178 Problem: empty() doesn't work for the new special variables. Solution: Make empty() work. (Damien) diff --git a/src/eval.c b/src/eval.c --- 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 --- 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 --- 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,