patch 8.1.1905: cannot set all properties of the info popup
Problem: Cannot set all properties of the info popup.
Solution: Add popup_findinfo(). Rename popup_getpreview() to
popup_findpreview().
diff --git a/src/testdir/dumps/Test_popupwin_infopopup_align_3.dump b/src/testdir/dumps/Test_popupwin_infopopup_align_3.dump
index 6effda0..2599094 100644
--- a/src/testdir/dumps/Test_popupwin_infopopup_align_3.dump
+++ b/src/testdir/dumps/Test_popupwin_infopopup_align_3.dump
@@ -8,7 +8,7 @@
|x| @7| +0#0000001#e0e0e08|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| | +0#0000000#ffffff0@43
|x| @7| +0#0000001#ffd7ff255|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0#0000000#ffffff0@43
|x| @7| +0#0000001#ffd7ff255|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| | +0#0000000#ffffff0@43
-|x| @7| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0&#e0e0e08|w|o|r|d|s| |a|r|e| |c|o@1|l| | +0#0000000#ffffff0@27
+|x| @7| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0#0000000#ffff4012|w|o|r|d|s| |a|r|e| |c|o@1|l| | +0&#ffffff0@27
|t|e|s|t| |t|e|x|t| |a|w|o|r|d> @59
|~+0#4040ff13&| @73
|-+2#0000000&@1| |U|s|e|r| |d|e|f|i|n|e|d| |c|o|m|p|l|e|t|i|o|n| |(|^|U|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |4| +0#0000000&@26
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 1f1f731..6c1ac52 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -2162,7 +2162,7 @@
call term_sendkeys(buf, "/another\<CR>\<C-W>}")
call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_2', {})
- call term_sendkeys(buf, ":call popup_move(popup_getpreview(), #{col: 15})\<CR>")
+ call term_sendkeys(buf, ":call popup_move(popup_findpreview(), #{col: 15})\<CR>")
call term_sendkeys(buf, ":\<CR>")
call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_3', {})
@@ -2245,6 +2245,10 @@
\ }
endfunc
call setline(1, 'text text text text text text text ')
+ func ChangeColor()
+ let id = popup_findinfo()
+ call popup_setoptions(id, #{highlight: 'InfoPopup'})
+ endfunc
END
return lines
endfunc
@@ -2313,6 +2317,7 @@
call VerifyScreenDump(buf, 'Test_popupwin_infopopup_align_2', {})
call term_sendkeys(buf, "\<Esc>")
+ call term_sendkeys(buf, ":call ChangeColor()\<CR>")
call term_sendkeys(buf, ":call setline(2, ['x']->repeat(10))\<CR>")
call term_sendkeys(buf, "Gotest text test text\<C-X>\<C-U>")
call VerifyScreenDump(buf, 'Test_popupwin_infopopup_align_3', {})