0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.1770: cannot get the window ID of the popup preview window

Problem:    Cannot get the window ID of the popup preview window.
Solution:   Add popup_getpreview().
This commit is contained in:
Bram Moolenaar
2019-07-28 17:57:43 +02:00
parent ac3150d385
commit 56c0c4749d
7 changed files with 33 additions and 2 deletions

View File

@@ -3019,7 +3019,15 @@ popup_find_preview_window(void)
for (wp = curtab->tp_first_popupwin; wp != NULL; wp = wp->w_next)
if (wp->w_p_pvw)
return wp;
return wp;
return NULL;
}
void
f_popup_getpreview(typval_T *argvars UNUSED, typval_T *rettv)
{
win_T *wp = popup_find_preview_window();
rettv->vval.v_number = wp == NULL ? 0 : wp->w_id;
}
int