Skip to content

Commit 1f42f5a

Browse files
committed
patch 8.2.1581: using line() for global popup window doesn't work
Problem: Using line() for global popup window doesn't work. Solution: Set tabpage to "curtab". (closes #6847)
1 parent a60053b commit 1f42f5a

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/evalwindow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ win_id2wp_tp(int id, tabpage_T **tpp)
117117
if (wp->w_id == id)
118118
{
119119
if (tpp != NULL)
120-
*tpp = tp;
120+
*tpp = curtab; // any tabpage would do
121121
return wp;
122122
}
123123
#endif

src/testdir/test_popupwin.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,6 +2239,18 @@ func Test_popup_settext()
22392239
call delete('XtestPopupSetText')
22402240
endfunc
22412241

2242+
func Test_popup_settext_getline()
2243+
let id = popup_create('', #{ tabpage: 0 })
2244+
call popup_settext(id, ['a','b'])
2245+
call assert_equal(2, line('$', id)) " OK :)
2246+
call popup_close(id)
2247+
2248+
let id = popup_create('', #{ tabpage: -1 })
2249+
call popup_settext(id, ['a','b'])
2250+
call assert_equal(2, line('$', id)) " Fails :(
2251+
call popup_close(id)
2252+
endfunc
2253+
22422254
func Test_popup_hidden()
22432255
new
22442256

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1581,
757759
/**/
758760
1580,
759761
/**/

0 commit comments

Comments
 (0)