0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.1.0166: using dict_add_nr_str() is clumsy

Problem:    Using dict_add_nr_str() is clumsy.
Solution:   Split into two functions. (Ozaki Kiichi, closes #3154)
This commit is contained in:
Bram Moolenaar
2018-07-08 16:50:37 +02:00
parent 4cde86c2ef
commit e0be167a80
13 changed files with 187 additions and 197 deletions

View File

@@ -4884,18 +4884,13 @@ ins_compl_insert(int in_compl_func)
dict = dict_alloc_lock(VAR_FIXED);
if (dict != NULL)
{
dict_add_nr_str(dict, "word", 0L,
EMPTY_IF_NULL(compl_shown_match->cp_str));
dict_add_nr_str(dict, "abbr", 0L,
EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_ABBR]));
dict_add_nr_str(dict, "menu", 0L,
EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_MENU]));
dict_add_nr_str(dict, "kind", 0L,
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]));
dict_add_string(dict, "word", compl_shown_match->cp_str);
dict_add_string(dict, "abbr", compl_shown_match->cp_text[CPT_ABBR]);
dict_add_string(dict, "menu", compl_shown_match->cp_text[CPT_MENU]);
dict_add_string(dict, "kind", compl_shown_match->cp_text[CPT_KIND]);
dict_add_string(dict, "info", compl_shown_match->cp_text[CPT_INFO]);
dict_add_string(dict, "user_data",
compl_shown_match->cp_text[CPT_USER_DATA]);
}
set_vim_var_dict(VV_COMPLETED_ITEM, dict);
if (!in_compl_func)