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().
diff --git a/src/popupwin.c b/src/popupwin.c
index 4c694c2..8ad6642 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -3019,7 +3019,15 @@
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