From d7f246c68cfb97406bcd4b098a2df2d870b3ef92 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 8 Apr 2019 18:15:41 +0200 Subject: 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) --- src/dict.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'src/dict.c') diff --git a/src/dict.c b/src/dict.c index 0bb9dfa87..7d49599ef 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) { @@ -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. -- cgit v1.2.1