changeset 18229:e6c83ae0c4d0 v8.1.2109

patch 8.1.2109: popup_getoptions() hangs with tab-local popup Commit: https://github.com/vim/vim/commit/1824f45883ef7cc236d2bba89811989a1ccb853c Author: Bram Moolenaar <Bram@vim.org> Date: Wed Oct 2 23:06:46 2019 +0200 patch 8.1.2109: popup_getoptions() hangs with tab-local popup Problem: popup_getoptions() hangs with tab-local popup. Solution: Correct pointer name. (Marko Mahni?, closes https://github.com/vim/vim/issues/5006)
author Bram Moolenaar <Bram@vim.org>
date Wed, 02 Oct 2019 23:15:03 +0200
parents 228e73d84c32
children 2a3de4cd6acb
files src/popupwin.c src/testdir/test_popupwin.vim src/version.c
diffstat 3 files changed, 19 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -2636,12 +2636,12 @@ f_popup_getoptions(typval_T *argvars, ty
 	i = 1;
 	FOR_ALL_TABPAGES(tp)
 	{
-	    win_T *p;
-
-	     for (p = tp->tp_first_popupwin; p != NULL; p = wp->w_next)
-		 if (p->w_id == id)
+	    win_T *twp;
+
+	     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;
 	}
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -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
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2109,
+/**/
     2108,
 /**/
     2107,