summaryrefslogtreecommitdiffstats
path: root/src/evalfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-03-29 12:20:27 +0100
committerBram Moolenaar <Bram@vim.org>2019-03-29 12:20:27 +0100
commitfd133323d4e1cc9c0e61c0ce357df4d36ea148e3 (patch)
treedb4227029ff088e984484404f690924f7ffa9fe1 /src/evalfunc.c
parent723d165c2fcd9f94af4e8719feda3b70c8f46868 (diff)
patch 8.1.1068: cannot get all the information about current completionv8.1.1068
Problem: Cannot get all the information about current completion. Solution: Add complete_info(). (Shougo, Hirohito Higashi, closes #4106)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r--src/evalfunc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index c1a32f3c27..6aff4994ca 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -113,6 +113,7 @@ static void f_col(typval_T *argvars, typval_T *rettv);
static void f_complete(typval_T *argvars, typval_T *rettv);
static void f_complete_add(typval_T *argvars, typval_T *rettv);
static void f_complete_check(typval_T *argvars, typval_T *rettv);
+static void f_complete_info(typval_T *argvars, typval_T *rettv);
#endif
static void f_confirm(typval_T *argvars, typval_T *rettv);
static void f_copy(typval_T *argvars, typval_T *rettv);
@@ -593,6 +594,7 @@ static struct fst
{"complete", 2, 2, f_complete},
{"complete_add", 1, 1, f_complete_add},
{"complete_check", 0, 0, f_complete_check},
+ {"complete_info", 0, 1, f_complete_info},
#endif
{"confirm", 1, 4, f_confirm},
{"copy", 1, 1, f_copy},
@@ -2600,6 +2602,29 @@ f_complete_check(typval_T *argvars UNUSED, typval_T *rettv)
rettv->vval.v_number = compl_interrupted;
RedrawingDisabled = saved;
}
+
+/*
+ * "complete_info()" function
+ */
+ static void
+f_complete_info(typval_T *argvars, typval_T *rettv)
+{
+ list_T *what_list = NULL;
+
+ if (rettv_dict_alloc(rettv) != OK)
+ return;
+
+ if (argvars[0].v_type != VAR_UNKNOWN)
+ {
+ if (argvars[0].v_type != VAR_LIST)
+ {
+ emsg(_(e_listreq));
+ return;
+ }
+ what_list = argvars[0].vval.v_list;
+ }
+ get_complete_info(what_list, rettv->vval.v_dict);
+}
#endif
/*