summaryrefslogtreecommitdiff
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-10 16:19:32 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-10 16:19:32 +0100
commit9b56a57cdae31f7a2c85d440392bf63d3253a158 (patch)
treec398e599f330084126ba3b9cdc3ef0e86ab8be1c /src/edit.c
parentb301f6b950975b9d7ae87a4f551b32bba63ccdcf (diff)
downloadvim-git-9b56a57cdae31f7a2c85d440392bf63d3253a158.tar.gz
patch 8.0.1493: completion items cannot be annotatedv8.0.1493
Problem: Completion items cannot be annotated. Solution: Add a "user_data" entry to the completion item. (Ben Jackson, coses #2608, closes #2508)
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/edit.c b/src/edit.c
index fa1d84bbc..a9e6343a8 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -4236,6 +4236,8 @@ ins_compl_add_tv(typval_T *tv, int dir)
(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 @@ ins_compl_insert(int in_compl_func)
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)