summaryrefslogtreecommitdiffstats
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-07-08 16:50:37 +0200
committerBram Moolenaar <Bram@vim.org>2018-07-08 16:50:37 +0200
commite0be167a805fd547c25ec1ec97fd4c7f13046236 (patch)
tree423fb96f7b30329ef0b7ccf3d4b2a02620e7929c /src/edit.c
parent4cde86c2ef885e82fff3d925dee9fb5671c025cf (diff)
patch 8.1.0166: using dict_add_nr_str() is clumsyv8.1.0166
Problem: Using dict_add_nr_str() is clumsy. Solution: Split into two functions. (Ozaki Kiichi, closes #3154)
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/edit.c b/src/edit.c
index 5f6ac19a06..657bd2c864 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -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)