]> granicus.if.org Git - vim/commitdiff
patch 8.1.2109: popup_getoptions() hangs with tab-local popup v8.1.2109
authorBram Moolenaar <Bram@vim.org>
Wed, 2 Oct 2019 21:06:46 +0000 (23:06 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 2 Oct 2019 21:06:46 +0000 (23:06 +0200)
Problem:    popup_getoptions() hangs with tab-local popup.
Solution:   Correct pointer name. (Marko Mahnič, closes #5006)

src/popupwin.c
src/testdir/test_popupwin.vim
src/version.c

index a77d98b6737e9c19da0eb140f37622796952fc0b..06812073e60b269c50a9ab10945f120ddd30df44 100644 (file)
@@ -2636,12 +2636,12 @@ f_popup_getoptions(typval_T *argvars, typval_T *rettv)
        i = 1;
        FOR_ALL_TABPAGES(tp)
        {
-           win_T *p;
+           win_T *twp;
 
-            for (p = tp->tp_first_popupwin; p != NULL; p = wp->w_next)
-                if (p->w_id == id)
+            for (twp = tp->tp_first_popupwin; twp != NULL; twp = twp->w_next)
+                if (twp->w_id == id)
                     break;
-            if (p != NULL)
+            if (twp != NULL)
                 break;
             ++i;
        }
index b9d6d830199eb1aa253b3083c77c5fc4c7417b29..9d8a0d099bdaab71a8c789b894ff2833058836c1 100644 (file)
@@ -2556,4 +2556,16 @@ func Test_popupwin_recycle_bnr()
   call popup_clear()
 endfunc
 
+func Test_popupwin_getoptions_tablocal()
+  topleft split
+  let win1 = popup_create('nothing', #{maxheight: 8})
+  let win2 = popup_create('something', #{maxheight: 10})
+  let win3 = popup_create('something', #{maxheight: 15})
+  call assert_equal(8, popup_getoptions(win1).maxheight)
+  call assert_equal(10, popup_getoptions(win2).maxheight)
+  call assert_equal(15, popup_getoptions(win3).maxheight)
+  call popup_clear()
+  quit
+endfunc
+
 " vim: shiftwidth=2 sts=2
index 469b759b673e3b222e69cbf8451cb13a6a2c32a7..00374c20e57ae2b59bb590e32bbde3632aceec52 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2109,
 /**/
     2108,
 /**/