1
0
forked from aniani/vim

patch 8.1.1673: cannot easily find the popup window at a certain position

Problem:    Cannot easily find the popup window at a certain position.
Solution:   Add popup_locate().
This commit is contained in:
Bram Moolenaar
2019-07-12 21:07:54 +02:00
parent d94ac0caca
commit b4f0628fc5
6 changed files with 32 additions and 1 deletions

View File

@@ -1890,6 +1890,20 @@ f_popup_getpos(typval_T *argvars, typval_T *rettv)
win_valid(wp) && (wp->w_popup_flags & POPF_HIDDEN) == 0);
}
}
/*
* popup_locate({row}, {col})
*/
void
f_popup_locate(typval_T *argvars, typval_T *rettv)
{
int row = tv_get_number(&argvars[0]) - 1;
int col = tv_get_number(&argvars[1]) - 1;
win_T *wp;
wp = mouse_find_win(&row, &col, FIND_POPUP);
if (WIN_IS_POPUP(wp))
rettv->vval.v_number = wp->w_id;
}
/*
* For popup_getoptions(): add a "border" or "padding" entry to "dict".