summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-02-06 14:59:27 +0100
committerBram Moolenaar <Bram@vim.org>2021-02-06 14:59:27 +0100
commitefa1923565f0669d5bc09714b22a3b50cde03785 (patch)
treed2b0c14d6cdbcdc8569affe864b73e8e98fb8a47
parent650264367725af6740b94cfd24d9f5caf0e91356 (diff)
patch 8.2.2471: popup_setoptions() does not set textprop in other tabv8.2.2471
Problem: Popup_setoptions() does not set textprop in other tab. Solution: use win_valid_any_tab(). (closes #7788)
-rw-r--r--src/popupwin.c2
-rw-r--r--src/testdir/test_popupwin.vim19
-rw-r--r--src/version.c2
3 files changed, 22 insertions, 1 deletions
diff --git a/src/popupwin.c b/src/popupwin.c
index 0896f1700d..436238f9ba 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -461,7 +461,7 @@ apply_move_options(win_T *wp, dict_T *d)
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))
+ if (!win_valid_any_tab(wp->w_popup_prop_win))
wp->w_popup_prop_win = curwin;
}
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 11b1c4a994..0d9d326bcc 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -3813,8 +3813,27 @@ func Test_popup_getoptions_other_tab()
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
diff --git a/src/version.c b/src/version.c
index 73bb1e211c..2beec07bc3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2471,
+/**/
2470,
/**/
2469,