0
0
mirror of https://github.com/vim/vim.git synced 2025-10-23 08:44:20 -04:00

patch 8.1.1138: plugins don't get notified when the popup menu changes

Problem:    Plugins don't get notified when the popup menu changes.
Solution:   Add the CompleteChanged event. (Andy Massimino. closes #4176)
This commit is contained in:
Bram Moolenaar
2019-04-08 18:15:41 +02:00
parent 62e1bb4a11
commit d7f246c68c
11 changed files with 165 additions and 18 deletions

View File

@@ -342,18 +342,18 @@ dict_add(dict_T *d, dictitem_T *item)
}
/*
* Add a number entry to dictionary "d".
* Add a number or special entry to dictionary "d".
* Returns FAIL when out of memory and when key already exists.
*/
int
dict_add_number(dict_T *d, char *key, varnumber_T nr)
static int
dict_add_number_special(dict_T *d, char *key, varnumber_T nr, int special)
{
dictitem_T *item;
item = dictitem_alloc((char_u *)key);
if (item == NULL)
return FAIL;
item->di_tv.v_type = VAR_NUMBER;
item->di_tv.v_type = special ? VAR_SPECIAL : VAR_NUMBER;
item->di_tv.vval.v_number = nr;
if (dict_add(d, item) == FAIL)
{
@@ -363,6 +363,26 @@ dict_add_number(dict_T *d, char *key, varnumber_T nr)
return OK;
}
/*
* Add a number entry to dictionary "d".
* Returns FAIL when out of memory and when key already exists.
*/
int
dict_add_number(dict_T *d, char *key, varnumber_T nr)
{
return dict_add_number_special(d, key, nr, FALSE);
}
/*
* Add a special entry to dictionary "d".
* Returns FAIL when out of memory and when key already exists.
*/
int
dict_add_special(dict_T *d, char *key, varnumber_T nr)
{
return dict_add_number_special(d, key, nr, TRUE);
}
/*
* Add a string entry to dictionary "d".
* Returns FAIL when out of memory and when key already exists.