summaryrefslogtreecommitdiffstats
path: root/src/insexpand.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-04 19:00:11 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-04 19:00:11 +0100
commitab782c5b6f127b84f56e546004352de66e7cf66b (patch)
tree019bc1bef68137dc5202b7bc40fe15d55547cf07 /src/insexpand.c
parent3d8a513b46b586cb5d2893e7f28c5f51c4dfdc17 (diff)
patch 8.2.0086: build error for small versionv8.2.0086
Problem: Build error for small version. (Tony Mechelynck) Solution: Only use "user_data" with the +eval feature. Remove unused variable.
Diffstat (limited to 'src/insexpand.c')
-rw-r--r--src/insexpand.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/insexpand.c b/src/insexpand.c
index 7407647490..acddd2658c 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -103,7 +103,9 @@ struct compl_S
compl_T *cp_prev;
char_u *cp_str; // matched text
char_u *(cp_text[CPT_COUNT]); // text for the menu
+#ifdef FEAT_EVAL
typval_T cp_user_data;
+#endif
char_u *cp_fname; // file containing the match, allocated when
// cp_flags has CP_FREE_FNAME
int cp_flags; // CP_ values
@@ -647,8 +649,10 @@ ins_compl_add(
if (cptext[i] != NULL && *cptext[i] != NUL)
match->cp_text[i] = vim_strsave(cptext[i]);
}
+#ifdef FEAT_EVAL
if (user_data != NULL)
match->cp_user_data = *user_data;
+#endif
// Link the new match structure in the list of matches.
if (compl_first_match == NULL)
@@ -1459,7 +1463,9 @@ ins_compl_free(void)
vim_free(match->cp_fname);
for (i = 0; i < CPT_COUNT; ++i)
vim_free(match->cp_text[i]);
+#ifdef FEAT_EVAL
clear_tv(&match->cp_user_data);
+#endif
vim_free(match);
} while (compl_curr_match != NULL && compl_curr_match != compl_first_match);
compl_first_match = compl_curr_match = NULL;