0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

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)
This commit is contained in:
Bram Moolenaar 2020-09-03 18:52:24 +02:00
parent a60053b8f4
commit 1f42f5a675
3 changed files with 15 additions and 1 deletions

View 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

View 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

View File

@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1581,
/**/
1580,
/**/