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:
@@ -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".
|
||||
|
Reference in New Issue
Block a user