Patch 8.2.2471

4 views
Skip to first unread message

Bram Moolenaar

unread,
Feb 6, 2021, 9:00:25 AM2/6/21
to vim...@googlegroups.com

Patch 8.2.2471
Problem: Popup_setoptions() does not set textprop in other tab.
Solution: use win_valid_any_tab(). (closes #7788)
Files: src/popupwin.c, src/testdir/test_popupwin.vim


*** ../vim-8.2.2470/src/popupwin.c 2021-02-06 14:22:28.960962796 +0100
--- src/popupwin.c 2021-02-06 14:58:22.102305630 +0100
***************
*** 461,467 ****
if (di != NULL)
{
wp->w_popup_prop_win = find_win_by_nr_or_id(&di->di_tv);
! if (!win_valid(wp->w_popup_prop_win))
wp->w_popup_prop_win = curwin;
}

--- 461,467 ----
if (di != NULL)
{
wp->w_popup_prop_win = find_win_by_nr_or_id(&di->di_tv);
! if (!win_valid_any_tab(wp->w_popup_prop_win))
wp->w_popup_prop_win = curwin;
}

*** ../vim-8.2.2470/src/testdir/test_popupwin.vim 2021-02-06 14:22:28.960962796 +0100
--- src/testdir/test_popupwin.vim 2021-02-06 14:57:47.174415368 +0100
***************
*** 3813,3820 ****
--- 3813,3839 ----
call assert_equal(['textprop', 'textpropid', 'textpropwin'], popup_getoptions(id)->keys()->filter({_, v -> v =~ 'textprop'}))

tabclose
+ call popup_close(id)
bwipe!
call prop_type_delete('textprop')
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-8.2.2470/src/version.c 2021-02-06 14:22:28.960962796 +0100
--- src/version.c 2021-02-06 14:53:45.335172823 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2471,
/**/

--
FATHER: Did you kill all those guards?
LAUNCELOT: Yes ... I'm very sorry ...
FATHER: They cost fifty pounds each!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages