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:
@@ -10578,6 +10578,10 @@ f_empty(argvars, rettv)
|
|||||||
n = argvars[0].vval.v_dict == NULL
|
n = argvars[0].vval.v_dict == NULL
|
||||||
|| argvars[0].vval.v_dict->dv_hashtab.ht_used == 0;
|
|| argvars[0].vval.v_dict->dv_hashtab.ht_used == 0;
|
||||||
break;
|
break;
|
||||||
|
case VAR_SPECIAL:
|
||||||
|
n = argvars[0].vval.v_number != VVAL_TRUE;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
EMSG2(_(e_intern2), "f_empty()");
|
EMSG2(_(e_intern2), "f_empty()");
|
||||||
n = 0;
|
n = 0;
|
||||||
|
@@ -987,6 +987,11 @@ func Test_type()
|
|||||||
call assert_equal(v:true, eval(string(v:true)))
|
call assert_equal(v:true, eval(string(v:true)))
|
||||||
call assert_equal(v:none, eval(string(v:none)))
|
call assert_equal(v:none, eval(string(v:none)))
|
||||||
call assert_equal(v:null, eval(string(v:null)))
|
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
|
endfunc
|
||||||
|
|
||||||
"-------------------------------------------------------------------------------
|
"-------------------------------------------------------------------------------
|
||||||
|
@@ -746,6 +746,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1178,
|
||||||
/**/
|
/**/
|
||||||
1177,
|
1177,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user