Commit: patch 9.2.1009: duplicate dict code in ins_compl_dict_alloc()

2 views
Skip to first unread message

Christian Brabandt

unread,
Aug 25, 2026, 4:45:18 PM (yesterday) Aug 25
to vim...@googlegroups.com
patch 9.2.1009: duplicate dict code in ins_compl_dict_alloc()

Commit: https://github.com/vim/vim/commit/303a153694d93e93620023835c64e4dc2122e3b2
Author: glepnir <gleph...@gmail.com>
Date: Tue Aug 25 20:35:00 2026 +0000

patch 9.2.1009: duplicate dict code in ins_compl_dict_alloc()

Problem: ins_compl_dict_alloc() builds the same dict as
fill_complete_info_dict().
Solution: Call fill_complete_info_dict() instead (glepnir).

closes: #21140

Signed-off-by: glepnir <gleph...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/insexpand.c b/src/insexpand.c
index e35fe54ca..bae461b06 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -333,6 +333,7 @@ static void ins_compl_add_dict(dict_T *dict);
static int get_userdefined_compl_info(colnr_T curs_col, callback_T *cb, int *startcol);
static void get_cpt_func_completion_matches(callback_T *cb);
static callback_T *get_callback_if_cpt_func(char_u *p, int idx);
+static void fill_complete_info_dict(dict_T *di, compl_T *match, int add_match);
#endif
static int setup_cpt_sources(void);
static int is_cpt_func_refresh_always(void);
@@ -1509,17 +1510,7 @@ ins_compl_dict_alloc(compl_T *match)

if (dict == NULL)
return NULL;
-
- dict_add_string_len(dict, "word", match->cp_str.string, (int)match->cp_str.length);
- dict_add_string(dict, "abbr", match->cp_text[CPT_ABBR]);
- dict_add_string(dict, "menu", match->cp_text[CPT_MENU]);
- dict_add_string(dict, "kind", match->cp_text[CPT_KIND]);
- dict_add_string(dict, "info", match->cp_text[CPT_INFO]);
- if (match->cp_user_data.v_type == VAR_UNKNOWN)
- dict_add_string_len(dict, "user_data", (char_u *)"", 0);
- else
- dict_add_tv(dict, "user_data", &match->cp_user_data);
-
+ fill_complete_info_dict(dict, match, FALSE);
return dict;
}

diff --git a/src/version.c b/src/version.c
index 80a2f1686..50a655d4d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -763,6 +763,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1009,
/**/
1008,
/**/
Reply all
Reply to author
Forward
0 new messages