Skip to content

Commit 6502643

Browse files
committed
patch 8.2.2470: popup_getoptions() does not get textprop from other tab
Problem: Popup_getoptions() does not get textprop from other tab. Solution: use win_valid_any_tab(). (closes #7786)
1 parent f5a5116 commit 6502643

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

src/popupwin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2983,7 +2983,7 @@ f_popup_getoptions(typval_T *argvars, typval_T *rettv)
29832983
dict_add_number(dict, "scrollbar", wp->w_want_scrollbar);
29842984
dict_add_number(dict, "zindex", wp->w_zindex);
29852985
dict_add_number(dict, "fixed", wp->w_popup_fixed);
2986-
if (wp->w_popup_prop_type && win_valid(wp->w_popup_prop_win))
2986+
if (wp->w_popup_prop_type && win_valid_any_tab(wp->w_popup_prop_win))
29872987
{
29882988
proptype_T *pt = text_prop_type_by_id(
29892989
wp->w_popup_prop_win->w_buffer,

src/testdir/test_popupwin.vim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3803,4 +3803,18 @@ func Test_popup_filter_menu()
38033803
call feedkeys("\<c-n>\<c-n>\<c-p>\<cr>", 'xt')
38043804
endfunc
38053805

3806+
func Test_popup_getoptions_other_tab()
3807+
new
3808+
call setline(1, 'some text')
3809+
call prop_type_add('textprop', {})
3810+
call prop_add(1, 1, #{type: 'textprop', length: 1})
3811+
let id = popup_create('TEST', #{textprop: 'textprop', highlight: 'ErrorMsg', tabpage: 1})
3812+
tab sp
3813+
call assert_equal(['textprop', 'textpropid', 'textpropwin'], popup_getoptions(id)->keys()->filter({_, v -> v =~ 'textprop'}))
3814+
3815+
tabclose
3816+
bwipe!
3817+
call prop_type_delete('textprop')
3818+
endfunc
3819+
38063820
" vim: shiftwidth=2 sts=2

src/version.c

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

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2470,
753755
/**/
754756
2469,
755757
/**/

0 commit comments

Comments
 (0)