comparison src/edit.c @ 13238:e0dcfd3dbb52 v8.0.1493

patch 8.0.1493: completion items cannot be annotated commit https://github.com/vim/vim/commit/9b56a57cdae31f7a2c85d440392bf63d3253a158 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 10 16:19:32 2018 +0100 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)
author Christian Brabandt <cb@256bit.org>
date Sat, 10 Feb 2018 16:30:06 +0100
parents ae5f855a64be
children 5ed6e4a25925
comparison
equal deleted inserted replaced
13237:ffad83212c90 13238:e0dcfd3dbb52
4234 (char_u *)"menu", FALSE); 4234 (char_u *)"menu", FALSE);
4235 cptext[CPT_KIND] = get_dict_string(tv->vval.v_dict, 4235 cptext[CPT_KIND] = get_dict_string(tv->vval.v_dict,
4236 (char_u *)"kind", FALSE); 4236 (char_u *)"kind", FALSE);
4237 cptext[CPT_INFO] = get_dict_string(tv->vval.v_dict, 4237 cptext[CPT_INFO] = get_dict_string(tv->vval.v_dict,
4238 (char_u *)"info", FALSE); 4238 (char_u *)"info", FALSE);
4239 cptext[CPT_USER_DATA] = get_dict_string(tv->vval.v_dict,
4240 (char_u *)"user_data", FALSE);
4239 if (get_dict_string(tv->vval.v_dict, (char_u *)"icase", FALSE) != NULL) 4241 if (get_dict_string(tv->vval.v_dict, (char_u *)"icase", FALSE) != NULL)
4240 icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase"); 4242 icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase");
4241 if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL) 4243 if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
4242 adup = get_dict_number(tv->vval.v_dict, (char_u *)"dup"); 4244 adup = get_dict_number(tv->vval.v_dict, (char_u *)"dup");
4243 if (get_dict_string(tv->vval.v_dict, (char_u *)"empty", FALSE) != NULL) 4245 if (get_dict_string(tv->vval.v_dict, (char_u *)"empty", FALSE) != NULL)
4756 EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_MENU])); 4758 EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_MENU]));
4757 dict_add_nr_str(dict, "kind", 0L, 4759 dict_add_nr_str(dict, "kind", 0L,
4758 EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_KIND])); 4760 EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_KIND]));
4759 dict_add_nr_str(dict, "info", 0L, 4761 dict_add_nr_str(dict, "info", 0L,
4760 EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_INFO])); 4762 EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_INFO]));
4763 dict_add_nr_str(dict, "user_data", 0L,
4764 EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_USER_DATA]));
4761 } 4765 }
4762 set_vim_var_dict(VV_COMPLETED_ITEM, dict); 4766 set_vim_var_dict(VV_COMPLETED_ITEM, dict);
4763 if (!in_compl_func) 4767 if (!in_compl_func)
4764 compl_curr_match = compl_shown_match; 4768 compl_curr_match = compl_shown_match;
4765 } 4769 }