Skip to content

Commit efa1923

Browse files
committed
patch 8.2.2471: popup_setoptions() does not set textprop in other tab
Problem: Popup_setoptions() does not set textprop in other tab. Solution: use win_valid_any_tab(). (closes #7788)
1 parent 6502643 commit efa1923

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

src/popupwin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ apply_move_options(win_T *wp, dict_T *d)
461461
if (di != NULL)
462462
{
463463
wp->w_popup_prop_win = find_win_by_nr_or_id(&di->di_tv);
464-
if (!win_valid(wp->w_popup_prop_win))
464+
if (!win_valid_any_tab(wp->w_popup_prop_win))
465465
wp->w_popup_prop_win = curwin;
466466
}
467467

src/testdir/test_popupwin.vim

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3813,8 +3813,27 @@ func Test_popup_getoptions_other_tab()
38133813
call assert_equal(['textprop', 'textpropid', 'textpropwin'], popup_getoptions(id)->keys()->filter({_, v -> v =~ 'textprop'}))
38143814

38153815
tabclose
3816+
call popup_close(id)
38163817
bwipe!
38173818
call prop_type_delete('textprop')
38183819
endfunc
38193820

3821+
3822+
func Test_popup_setoptions_other_tab()
3823+
new Xfile
3824+
let winid = win_getid()
3825+
call setline(1, 'some text')
3826+
call prop_type_add('textprop', {})
3827+
call prop_add(1, 1, #{type: 'textprop', length: 1})
3828+
let id = popup_create('TEST', #{textprop: 'textprop'})
3829+
tab sp
3830+
call popup_setoptions(id, #{textprop: 'textprop', textpropwin: winid})
3831+
call assert_equal(winid, popup_getoptions(id).textpropwin)
3832+
3833+
tabclose
3834+
call popup_close(id)
3835+
bwipe! Xfile
3836+
call prop_type_delete('textprop')
3837+
endfunc
3838+
38203839
" 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+
2471,
753755
/**/
754756
2470,
755757
/**/

0 commit comments

Comments
 (0)