patch 8.2.0748: cannot get a list of all popups
Problem: Cannot get a list of all popups.
Solution: Add popup_list(). Use it in the test runner.
diff --git a/src/popupwin.c b/src/popupwin.c
index f1f9f60..a244c32 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -2720,6 +2720,25 @@
hash_unlock(&dict->dv_hashtab);
}
}
+
+/*
+ * popup_list()
+ */
+ void
+f_popup_list(typval_T *argvars UNUSED, typval_T *rettv)
+{
+ win_T *wp;
+ tabpage_T *tp;
+
+ if (rettv_list_alloc(rettv) != OK)
+ return;
+ FOR_ALL_POPUPWINS(wp)
+ list_append_number(rettv->vval.v_list, wp->w_id);
+ FOR_ALL_TABPAGES(tp)
+ FOR_ALL_POPUPWINS_IN_TAB(tp, wp)
+ list_append_number(rettv->vval.v_list, wp->w_id);
+}
+
/*
* popup_locate({row}, {col})
*/