1
0
forked from aniani/vim

patch 8.1.1561: popup_setoptions() is not implemented yet

Problem:    Popup_setoptions() is not implemented yet.
Solution:   Implement popup_setoptions().  Also add more fields to
            popup_getoptions().
This commit is contained in:
Bram Moolenaar
2019-06-16 22:54:14 +02:00
parent 6313c4f41d
commit ae943150d3
9 changed files with 364 additions and 89 deletions

View File

@@ -447,6 +447,27 @@ dict_add_list(dict_T *d, char *key, list_T *list)
return OK;
}
/*
* Add a callback to dictionary "d".
* Returns FAIL when out of memory and when key already exists.
*/
int
dict_add_callback(dict_T *d, char *key, callback_T *cb)
{
dictitem_T *item;
item = dictitem_alloc((char_u *)key);
if (item == NULL)
return FAIL;
put_callback(cb, &item->di_tv);
if (dict_add(d, item) == FAIL)
{
dictitem_free(item);
return FAIL;
}
return OK;
}
/*
* Initializes "iter" for iterating over dictionary items with
* dict_iterate_next().