diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-04-08 18:15:41 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-04-08 18:15:41 +0200 |
commit | d7f246c68cfb97406bcd4b098a2df2d870b3ef92 (patch) | |
tree | 54fb7c248c198f511947c45a8942302d8d2a041a /src/dict.c | |
parent | 62e1bb4a111e7ce570c30965f40a68a07a9da5b0 (diff) |
patch 8.1.1138: plugins don't get notified when the popup menu changesv8.1.1138
Problem: Plugins don't get notified when the popup menu changes.
Solution: Add the CompleteChanged event. (Andy Massimino. closes #4176)
Diffstat (limited to 'src/dict.c')
-rw-r--r-- | src/dict.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/dict.c b/src/dict.c index 0bb9dfa875..7d49599efa 100644 --- a/src/dict.c +++ b/src/dict.c @@ -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) { @@ -364,6 +364,26 @@ dict_add_number(dict_T *d, char *key, varnumber_T nr) } /* + * 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. */ |