summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-02-06 14:22:32 +0100
committerBram Moolenaar <Bram@vim.org>2021-02-06 14:22:32 +0100
commit650264367725af6740b94cfd24d9f5caf0e91356 (patch)
tree29b4042b844235dbe15acd62e4af8c334a2c7fd9
parentf5a5116a96b1877c3f44e7bae288fd6603151eb1 (diff)
downloadvim-git-650264367725af6740b94cfd24d9f5caf0e91356.tar.gz
patch 8.2.2470: popup_getoptions() does not get textprop from other tabv8.2.2470
Problem: Popup_getoptions() does not get textprop from other tab. Solution: use win_valid_any_tab(). (closes #7786)
-rw-r--r--src/popupwin.c2
-rw-r--r--src/testdir/test_popupwin.vim14
-rw-r--r--src/version.c2
3 files changed, 17 insertions, 1 deletions
diff --git a/src/popupwin.c b/src/popupwin.c
index fddcaa1b4..0896f1700 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -2983,7 +2983,7 @@ f_popup_getoptions(typval_T *argvars, typval_T *rettv)
dict_add_number(dict, "scrollbar", wp->w_want_scrollbar);
dict_add_number(dict, "zindex", wp->w_zindex);
dict_add_number(dict, "fixed", wp->w_popup_fixed);
- if (wp->w_popup_prop_type && win_valid(wp->w_popup_prop_win))
+ if (wp->w_popup_prop_type && win_valid_any_tab(wp->w_popup_prop_win))
{
proptype_T *pt = text_prop_type_by_id(
wp->w_popup_prop_win->w_buffer,
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 7335c1c13..11b1c4a99 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -3803,4 +3803,18 @@ func Test_popup_filter_menu()
call feedkeys("\<c-n>\<c-n>\<c-p>\<cr>", 'xt')
endfunc
+func Test_popup_getoptions_other_tab()
+ new
+ 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', highlight: 'ErrorMsg', tabpage: 1})
+ tab sp
+ call assert_equal(['textprop', 'textpropid', 'textpropwin'], popup_getoptions(id)->keys()->filter({_, v -> v =~ 'textprop'}))
+
+ tabclose
+ bwipe!
+ call prop_type_delete('textprop')
+endfunc
+
" vim: shiftwidth=2 sts=2
diff --git a/src/version.c b/src/version.c
index fb3a50ac6..73bb1e211 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 */
/**/
+ 2470,
+/**/
2469,
/**/
2468,