forked from aniani/vim
patch 9.0.0936: wrong type for "isunnamed" returned by getreginfo()
Problem: Wrong type for "isunnamed" returned by getreginfo(). Solution: Use VAR_BOOL instead of VAR_SPECIAL. (closes #11598)
This commit is contained in:
@@ -8415,7 +8415,7 @@ f_getreginfo(typval_T *argvars, typval_T *rettv)
|
|||||||
|
|
||||||
if (item != NULL)
|
if (item != NULL)
|
||||||
{
|
{
|
||||||
item->di_tv.v_type = VAR_SPECIAL;
|
item->di_tv.v_type = VAR_BOOL;
|
||||||
item->di_tv.vval.v_number = regname == buf[0]
|
item->di_tv.vval.v_number = regname == buf[0]
|
||||||
? VVAL_TRUE : VVAL_FALSE;
|
? VVAL_TRUE : VVAL_FALSE;
|
||||||
(void)dict_add(dict, item);
|
(void)dict_add(dict, item);
|
||||||
|
@@ -520,6 +520,13 @@ func Test_get_reginfo()
|
|||||||
nunmap <F2>
|
nunmap <F2>
|
||||||
unlet g:RegInfo
|
unlet g:RegInfo
|
||||||
|
|
||||||
|
" The type of "isunnamed" was VAR_SPECIAL but should be VAR_BOOL. Can only
|
||||||
|
" be noticed when using json_encod().
|
||||||
|
call setreg('a', 'foo')
|
||||||
|
let reginfo = getreginfo('a')
|
||||||
|
let expected = #{regcontents: ['foo'], isunnamed: v:false, regtype: 'v'}
|
||||||
|
call assert_equal(json_encode(expected), json_encode(reginfo))
|
||||||
|
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -695,6 +695,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 */
|
||||||
|
/**/
|
||||||
|
936,
|
||||||
/**/
|
/**/
|
||||||
935,
|
935,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user