patch 8.1.1407: popup_create() does not support text properties
Problem: Popup_create() does not support text properties.
Solution: Support the third form of the text argument.
diff --git a/src/testdir/dumps/Test_popupwin_02.dump b/src/testdir/dumps/Test_popupwin_02.dump
index c2aa7a2..0de7f49 100644
--- a/src/testdir/dumps/Test_popupwin_02.dump
+++ b/src/testdir/dumps/Test_popupwin_02.dump
@@ -2,9 +2,9 @@
> +0#0000000#ffffff0@74
|~+0#4040ff13&| @73
|~| @6|o+0#0000001#ffd7ff255|t|h|e|r| |t|a|b| @10| +0#4040ff13#ffffff0@46
+|~| @6|a+0#0000001#ffd7ff255| |c+0#ff404010&|o|m@1|e|n|t| +0#0000001&|l|i|n|e| @5| +0#4040ff13#ffffff0@46
|~| @73
|~| @73
|~| @73
|~| @73
-|~| @73
-|:+0#0000000&|c|a|l@1| |p|o|p|u|p|_|c|r|e|a|t|e|(|'|o|t|h|e|r| |t|a|b|'|,| |{|'|l|i|n|e|'|:| |4|,| |'|c|o|l|'|:| |9|}|)| @2|0|,|0|-|1| @8|A|l@1|
+| +0#0000000&@56|0|,|0|-|1| @8|A|l@1|
diff --git a/src/testdir/dumps/Test_popupwin_03.dump b/src/testdir/dumps/Test_popupwin_03.dump
index 4f6f9dd..d842654 100644
--- a/src/testdir/dumps/Test_popupwin_03.dump
+++ b/src/testdir/dumps/Test_popupwin_03.dump
@@ -7,4 +7,4 @@
|6| @73
|7| @73
|8| @73
-|:|c|a|l@1| |p|o|p|u|p|_|c|r|e|a|t|e|(|'|o|t|h|e|r| |t|a|b|'|,| |{|'|l|i|n|e|'|:| |4|,| |'|c|o| @9|1|,|1| @10|T|o|p|
+@57|1|,|1| @10|T|o|p|
diff --git a/src/testdir/dumps/Test_popupwin_04.dump b/src/testdir/dumps/Test_popupwin_04.dump
index a642455..c8b0438 100644
--- a/src/testdir/dumps/Test_popupwin_04.dump
+++ b/src/testdir/dumps/Test_popupwin_04.dump
@@ -2,7 +2,7 @@
|~+0#4040ff13&| @73
|~| @73
|~| @6|o+0#0000001#ffd7ff255|t|h|e|r| |t|a|b| @10| +0#4040ff13#ffffff0@46
-|~| @73
+|~| @6|a+0#0000001#ffd7ff255| |c+0#ff404010&|o|m@1|e|n|t| +0#0000001&|l|i|n|e| @5| +0#4040ff13#ffffff0@46
|~| @73
|~| @73
|~| @73
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 73efe0a..f1394fb 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -14,6 +14,8 @@
\ "call setline(1, range(1, 100))",
\ "hi PopupColor1 ctermbg=lightblue",
\ "hi PopupColor2 ctermbg=lightcyan",
+ \ "hi Comment ctermfg=red",
+ \ "call prop_type_add('comment', {'highlight': 'Comment'})",
\ "let winid = popup_create('hello there', {'line': 3, 'col': 11, 'highlight': 'PopupColor1'})",
\ "let winid2 = popup_create(['another one', 'another two', 'another three'], {'line': 3, 'col': 25})",
\ "call setwinvar(winid2, '&wincolor', 'PopupColor2')",
@@ -23,7 +25,12 @@
" Add a tabpage
call term_sendkeys(buf, ":tabnew\<CR>")
- call term_sendkeys(buf, ":call popup_create('other tab', {'line': 4, 'col': 9})\<CR>")
+ call term_sendkeys(buf, ":call popup_create(["
+ \ .. "{'text': 'other tab'},"
+ \ .. "{'text': 'a comment line', 'props': [{"
+ \ .. "'col': 3, 'length': 7, 'type': 'comment'"
+ \ .. "}]},"
+ \ .. "], {'line': 4, 'col': 9})\<CR>")
call VerifyScreenDump(buf, 'Test_popupwin_02', {})
" switch back to first tabpage