patch 8.0.1493: completion items cannot be annotated
Problem: Completion items cannot be annotated.
Solution: Add a "user_data" entry to the completion item. (Ben Jackson,
coses #2608, closes #2508)
diff --git a/src/edit.c b/src/edit.c
index fa1d84b..a9e6343 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -4236,6 +4236,8 @@
(char_u *)"kind", FALSE);
cptext[CPT_INFO] = get_dict_string(tv->vval.v_dict,
(char_u *)"info", FALSE);
+ cptext[CPT_USER_DATA] = get_dict_string(tv->vval.v_dict,
+ (char_u *)"user_data", FALSE);
if (get_dict_string(tv->vval.v_dict, (char_u *)"icase", FALSE) != NULL)
icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase");
if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
@@ -4758,6 +4760,8 @@
EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_KIND]));
dict_add_nr_str(dict, "info", 0L,
EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_INFO]));
+ dict_add_nr_str(dict, "user_data", 0L,
+ EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_USER_DATA]));
}
set_vim_var_dict(VV_COMPLETED_ITEM, dict);
if (!in_compl_func)