0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 7.4.1178

Problem:    empty() doesn't work for the new special variables.
Solution:   Make empty() work. (Damien)
This commit is contained in:
Bram Moolenaar
2016-01-25 20:22:54 +01:00
parent 5aec481097
commit 767d8c1a1a
3 changed files with 11 additions and 0 deletions

View File

@@ -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;

View File

@@ -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
"-------------------------------------------------------------------------------

View File

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