]> granicus.if.org Git - vim/commitdiff
patch 8.2.1581: using line() for global popup window doesn't work v8.2.1581
authorBram Moolenaar <Bram@vim.org>
Thu, 3 Sep 2020 16:52:24 +0000 (18:52 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 3 Sep 2020 16:52:24 +0000 (18:52 +0200)
Problem:    Using line() for global popup window doesn't work.
Solution:   Set tabpage to "curtab". (closes #6847)

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

index b50776d74d8b04e90d3cd98cd3b0952c0fe26b8c..3ddd96bcbc638e95c4aa210b02b523942f74297e 100644 (file)
@@ -117,7 +117,7 @@ win_id2wp_tp(int id, tabpage_T **tpp)
        if (wp->w_id == id)
        {
            if (tpp != NULL)
-               *tpp = tp;
+               *tpp = curtab;  // any tabpage would do
            return wp;
        }
 #endif
index 9e35c7ffc7f3bfb8fe6a6e51725edba9ac3d17f5..ec4898fa63e507087424597b76179e7f99017c7e 100644 (file)
@@ -2239,6 +2239,18 @@ func Test_popup_settext()
   call delete('XtestPopupSetText')
 endfunc
 
+func Test_popup_settext_getline()
+  let id = popup_create('', #{ tabpage: 0 })
+  call popup_settext(id, ['a','b'])
+  call assert_equal(2, line('$', id)) " OK :)
+  call popup_close(id)
+
+  let id = popup_create('', #{ tabpage: -1 })
+  call popup_settext(id, ['a','b'])
+  call assert_equal(2, line('$', id)) " Fails :(
+  call popup_close(id)
+endfunc
+
 func Test_popup_hidden()
   new
 
index 8d20b46befb0f8f4c14c829394e6dd2784032681..39e81bc9ad893ad73f1f51d7ea57d81a75ca3d9b 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1581,
 /**/
     1580,
 /**/