diff src/popupwin.c @ 20386:3b3589275ab9 v8.2.0748

patch 8.2.0748: cannot get a list of all popups Commit: https://github.com/vim/vim/commit/ef6b979bfae82f64781d8b0ce0194c57111243d4 Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 13 16:34:15 2020 +0200 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.
author Bram Moolenaar <Bram@vim.org>
date Wed, 13 May 2020 16:45:05 +0200
parents 42ab4d40e78f
children 4c317d8c1051
line wrap: on
line diff
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -2720,6 +2720,25 @@ f_popup_getpos(typval_T *argvars, typval
 	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})
  */