0
0
mirror of https://github.com/vim/vim.git synced 2025-10-14 07:04:10 -04:00

patch 8.1.1875: cannot get size and position of the popup menu

Problem:    Cannot get size and position of the popup menu.
Solution:   Add pum_getpos(). (Ben Jackson, closes #4827)
This commit is contained in:
Bram Moolenaar
2019-08-17 19:36:06 +02:00
parent 4dd751b956
commit e9bd57286a
5 changed files with 83 additions and 1 deletions

View File

@@ -234,6 +234,7 @@ static void f_pow(typval_T *argvars, typval_T *rettv);
#endif
static void f_prevnonblank(typval_T *argvars, typval_T *rettv);
static void f_printf(typval_T *argvars, typval_T *rettv);
static void f_pum_getpos(typval_T *argvars, typval_T *rettv);
static void f_pumvisible(typval_T *argvars, typval_T *rettv);
#ifdef FEAT_PYTHON3
static void f_py3eval(typval_T *argvars, typval_T *rettv);
@@ -741,6 +742,7 @@ static funcentry_T global_functions[] =
{"prop_type_get", 1, 2, 0, f_prop_type_get},
{"prop_type_list", 0, 1, 0, f_prop_type_list},
#endif
{"pum_getpos", 0, 0, 0, f_pum_getpos},
{"pumvisible", 0, 0, 0, f_pumvisible},
#ifdef FEAT_PYTHON3
{"py3eval", 1, 1, 0, f_py3eval},
@@ -7960,6 +7962,19 @@ f_printf(typval_T *argvars, typval_T *rettv)
did_emsg |= saved_did_emsg;
}
/*
* "pum_getpos()" function
*/
static void
f_pum_getpos(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
if (rettv_dict_alloc(rettv) != OK)
return;
#ifdef FEAT_INS_EXPAND
pum_set_event_info(rettv->vval.v_dict);
#endif
}
/*
* "pumvisible()" function
*/