diff options
author | Shougo <Shougo.Matsu@gmail.com> | 2018-02-19 07:56:59 +0900 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-02-18 23:56:59 +0100 |
commit | 00665d3c701ef1b6b276f750a772a6aa8a42c8c1 (patch) | |
tree | d144bc9824f698909fe651451fed38bbbd752f36 /src/nvim/edit.c | |
parent | eccd60aaf4ebc445d45e51a73d0807242e496a6a (diff) | |
download | rneovim-00665d3c701ef1b6b276f750a772a6aa8a42c8c1.tar.gz rneovim-00665d3c701ef1b6b276f750a772a6aa8a42c8c1.tar.bz2 rneovim-00665d3c701ef1b6b276f750a772a6aa8a42c8c1.zip |
vim-patch:8.0.1493: completion items cannot be annotated (#8003)
Problem: Completion items cannot be annotated.
Solution: Add a "user_data" entry to the completion item. (Ben Jackson,
coses vim/vim#2608, closes vim/vim#2508)
https://github.com/vim/vim/commit/9b56a57cdae31f7a2c85d440392bf63d3253a158
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index e67ac7d49f..35bbe04ff0 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -3600,6 +3600,8 @@ int ins_compl_add_tv(typval_T *const tv, const Direction dir) cptext[CPT_MENU] = tv_dict_get_string(tv->vval.v_dict, "menu", true); cptext[CPT_KIND] = tv_dict_get_string(tv->vval.v_dict, "kind", true); cptext[CPT_INFO] = tv_dict_get_string(tv->vval.v_dict, "info", true); + cptext[CPT_USER_DATA] = tv_dict_get_string(tv->vval.v_dict, + "user_data", true); icase = (bool)tv_dict_get_number(tv->vval.v_dict, "icase"); adup = (bool)tv_dict_get_number(tv->vval.v_dict, "dup"); @@ -4043,8 +4045,9 @@ static void ins_compl_insert(int in_compl_func) // Set completed item. // { word, abbr, menu, kind, info } dict_T *dict = tv_dict_alloc(); - tv_dict_add_str(dict, S_LEN("word"), - (const char *)EMPTY_IF_NULL(compl_shown_match->cp_str)); + tv_dict_add_str( + dict, S_LEN("word"), + (const char *)EMPTY_IF_NULL(compl_shown_match->cp_str)); tv_dict_add_str( dict, S_LEN("abbr"), (const char *)EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_ABBR])); @@ -4057,6 +4060,9 @@ static void ins_compl_insert(int in_compl_func) tv_dict_add_str( dict, S_LEN("info"), (const char *)EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_INFO])); + tv_dict_add_str( + dict, S_LEN("user_data"), + (const char *)EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_USER_DATA])); set_vim_var_dict(VV_COMPLETED_ITEM, dict); if (!in_compl_func) { compl_curr_match = compl_shown_match; |