summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-03 18:52:24 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-03 18:52:24 +0200
commit1f42f5a675fdab9ce5cdafbecea59c45e81f7ff8 (patch)
tree40d1a9caf029fa2c88a94c7e4169da987cfc60e6
parenta60053b8f4cc7e135ba9496a8f4855d26aee09e7 (diff)
patch 8.2.1581: using line() for global popup window doesn't workv8.2.1581
Problem: Using line() for global popup window doesn't work. Solution: Set tabpage to "curtab". (closes #6847)
-rw-r--r--src/evalwindow.c2
-rw-r--r--src/testdir/test_popupwin.vim12
-rw-r--r--src/version.c2
3 files changed, 15 insertions, 1 deletions
diff --git a/src/evalwindow.c b/src/evalwindow.c
index b50776d74d..3ddd96bcbc 100644
--- a/src/evalwindow.c
+++ b/src/evalwindow.c
@@ -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
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 9e35c7ffc7..ec4898fa63 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index 8d20b46bef..39e81bc9ad 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1581,
+/**/
1580,
/**/
1579,