diff src/evalfunc.c @ 17253:26e0352613ec v8.1.1626

patch 8.1.1626: no test for closing a popup window with a modified buffer commit https://github.com/vim/vim/commit/5ca1ac373ae62b37152cb6f85916b402eda520a5 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jul 4 15:39:28 2019 +0200 patch 8.1.1626: no test for closing a popup window with a modified buffer Problem: No test for closing a popup window with a modified buffer. Solution: Add a test. Add "popups" to getbufinfo().
author Bram Moolenaar <Bram@vim.org>
date Thu, 04 Jul 2019 15:45:05 +0200
parents 24f42f0bf27e
children 8a095d343c59
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -4509,10 +4509,10 @@ get_buffer_info(buf_T *buf)
     dict_add_number(dict, "hidden",
 			    buf->b_ml.ml_mfp != NULL && buf->b_nwindows == 0);
 
-    /* Get a reference to buffer variables */
+    // Get a reference to buffer variables
     dict_add_dict(dict, "variables", buf->b_vars);
 
-    /* List of windows displaying this buffer */
+    // List of windows displaying this buffer
     windows = list_alloc();
     if (windows != NULL)
     {
@@ -4522,6 +4522,23 @@ get_buffer_info(buf_T *buf)
 	dict_add_list(dict, "windows", windows);
     }
 
+#ifdef FEAT_TEXT_PROP
+    // List of popup windows displaying this buffer
+    windows = list_alloc();
+    if (windows != NULL)
+    {
+	for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
+	    if (wp->w_buffer == buf)
+		list_append_number(windows, (varnumber_T)wp->w_id);
+	FOR_ALL_TABPAGES(tp)
+	    for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next)
+		if (wp->w_buffer == buf)
+		    list_append_number(windows, (varnumber_T)wp->w_id);
+
+	dict_add_list(dict, "popups", windows);
+    }
+#endif
+
 #ifdef FEAT_SIGNS
     if (buf->b_signlist != NULL)
     {
@@ -5685,7 +5702,7 @@ get_tabpage_info(tabpage_T *tp, int tp_i
     if (l != NULL)
     {
 	for (wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
-		wp; wp = wp->w_next)
+						   wp != NULL; wp = wp->w_next)
 	    list_append_number(l, (varnumber_T)wp->w_id);
 	dict_add_list(dict, "windows", l);
     }