diff src/testdir/test_popupwin.vim @ 23859:12b446696927 v8.2.2471

patch 8.2.2471: popup_setoptions() does not set textprop in other tab Commit: https://github.com/vim/vim/commit/efa1923565f0669d5bc09714b22a3b50cde03785 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 6 14:59:27 2021 +0100 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 https://github.com/vim/vim/issues/7788)
author Bram Moolenaar <Bram@vim.org>
date Sat, 06 Feb 2021 15:00:04 +0100
parents 16a19892e22e
children 3033dade50ca
line wrap: on
line diff
--- 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