mirror of
https://github.com/vim/vim.git
synced 2025-10-13 06:54:15 -04:00
patch 8.1.1068: cannot get all the information about current completion
Problem: Cannot get all the information about current completion. Solution: Add complete_info(). (Shougo, Hirohito Higashi, closes #4106)
This commit is contained in:
@@ -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
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user