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

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)
This commit is contained in:
Bram Moolenaar 2021-02-06 14:59:27 +01:00
parent 6502643677
commit efa1923565
3 changed files with 22 additions and 1 deletions

View File

@ -461,7 +461,7 @@ apply_move_options(win_T *wp, dict_T *d)
if (di != NULL) if (di != NULL)
{ {
wp->w_popup_prop_win = find_win_by_nr_or_id(&di->di_tv); wp->w_popup_prop_win = find_win_by_nr_or_id(&di->di_tv);
if (!win_valid(wp->w_popup_prop_win)) if (!win_valid_any_tab(wp->w_popup_prop_win))
wp->w_popup_prop_win = curwin; wp->w_popup_prop_win = curwin;
} }

View File

@ -3813,8 +3813,27 @@ func Test_popup_getoptions_other_tab()
call assert_equal(['textprop', 'textpropid', 'textpropwin'], popup_getoptions(id)->keys()->filter({_, v -> v =~ 'textprop'})) call assert_equal(['textprop', 'textpropid', 'textpropwin'], popup_getoptions(id)->keys()->filter({_, v -> v =~ 'textprop'}))
tabclose tabclose
call popup_close(id)
bwipe! bwipe!
call prop_type_delete('textprop') call prop_type_delete('textprop')
endfunc endfunc
func Test_popup_setoptions_other_tab()
new Xfile
let winid = win_getid()
call setline(1, 'some text')
call prop_type_add('textprop', {})
call prop_add(1, 1, #{type: 'textprop', length: 1})
let id = popup_create('TEST', #{textprop: 'textprop'})
tab sp
call popup_setoptions(id, #{textprop: 'textprop', textpropwin: winid})
call assert_equal(winid, popup_getoptions(id).textpropwin)
tabclose
call popup_close(id)
bwipe! Xfile
call prop_type_delete('textprop')
endfunc
" vim: shiftwidth=2 sts=2 " vim: shiftwidth=2 sts=2

View File

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