patch 8.1.1559: popup window title property not implemented yet
Problem: Popup window title property not implemented yet.
Solution: Implement the title property.
diff --git a/src/testdir/dumps/Test_popupwin_menu_01.dump b/src/testdir/dumps/Test_popupwin_menu_01.dump
index debd962..479edf6 100644
--- a/src/testdir/dumps/Test_popupwin_menu_01.dump
+++ b/src/testdir/dumps/Test_popupwin_menu_01.dump
@@ -1,10 +1,10 @@
>1+0&#ffffff0| @73
-|2| @30|╔+0#0000001#ffd7ff255|═@8|╗| +0#0000000#ffffff0@31
-|3| @30|║+0#0000001#ffd7ff255| @8|║| +0#0000000#ffffff0@31
-|4| @30|║+0#0000001#ffd7ff255| |o+0#0000000#5fd7ff255|n|e| +0#0000001#ffd7ff255@4|║| +0#0000000#ffffff0@31
-|5| @30|║+0#0000001#ffd7ff255| |t|w|o| @4|║| +0#0000000#ffffff0@31
-|6| @30|║+0#0000001#ffd7ff255| |a|n|o|t|h|e|r| |║| +0#0000000#ffffff0@31
-|7| @30|║+0#0000001#ffd7ff255| @8|║| +0#0000000#ffffff0@31
-|8| @30|╚+0#0000001#ffd7ff255|═@8|╝| +0#0000000#ffffff0@31
+|2| @20|╔+0#0000001#ffd7ff255| |m|a|k|e| |a| |c|h|o|i|c|e| |f|r|o|m| |t|h|e| |l|i|s|t| |╗| +0#0000000#ffffff0@21
+|3| @20|║+0#0000001#ffd7ff255| @28|║| +0#0000000#ffffff0@21
+|4| @20|║+0#0000001#ffd7ff255| |o+0#0000000#5fd7ff255|n|e| +0#0000001#ffd7ff255@24|║| +0#0000000#ffffff0@21
+|5| @20|║+0#0000001#ffd7ff255| |t|w|o| @24|║| +0#0000000#ffffff0@21
+|6| @20|║+0#0000001#ffd7ff255| |a|n|o|t|h|e|r| @20|║| +0#0000000#ffffff0@21
+|7| @20|║+0#0000001#ffd7ff255| @28|║| +0#0000000#ffffff0@21
+|8| @20|╚+0#0000001#ffd7ff255|═@28|╝| +0#0000000#ffffff0@21
|9| @73
@57|1|,|1| @10|T|o|p|
diff --git a/src/testdir/dumps/Test_popupwin_menu_02.dump b/src/testdir/dumps/Test_popupwin_menu_02.dump
index 2495edf..4a407d4 100644
--- a/src/testdir/dumps/Test_popupwin_menu_02.dump
+++ b/src/testdir/dumps/Test_popupwin_menu_02.dump
@@ -1,10 +1,10 @@
>1+0&#ffffff0| @73
-|2| @30|╔+0#0000001#ffd7ff255|═@8|╗| +0#0000000#ffffff0@31
-|3| @30|║+0#0000001#ffd7ff255| @8|║| +0#0000000#ffffff0@31
-|4| @30|║+0#0000001#ffd7ff255| |o|n|e| @4|║| +0#0000000#ffffff0@31
-|5| @30|║+0#0000001#ffd7ff255| |t|w|o| @4|║| +0#0000000#ffffff0@31
-|6| @30|║+0#0000001#ffd7ff255| |a+0#0000000#5fd7ff255|n|o|t|h|e|r| +0#0000001#ffd7ff255|║| +0#0000000#ffffff0@31
-|7| @30|║+0#0000001#ffd7ff255| @8|║| +0#0000000#ffffff0@31
-|8| @30|╚+0#0000001#ffd7ff255|═@8|╝| +0#0000000#ffffff0@31
+|2| @20|╔+0#0000001#ffd7ff255| |m|a|k|e| |a| |c|h|o|i|c|e| |f|r|o|m| |t|h|e| |l|i|s|t| |╗| +0#0000000#ffffff0@21
+|3| @20|║+0#0000001#ffd7ff255| @28|║| +0#0000000#ffffff0@21
+|4| @20|║+0#0000001#ffd7ff255| |o|n|e| @24|║| +0#0000000#ffffff0@21
+|5| @20|║+0#0000001#ffd7ff255| |t|w|o| @24|║| +0#0000000#ffffff0@21
+|6| @20|║+0#0000001#ffd7ff255| |a+0#0000000#5fd7ff255|n|o|t|h|e|r| +0#0000001#ffd7ff255@20|║| +0#0000000#ffffff0@21
+|7| @20|║+0#0000001#ffd7ff255| @28|║| +0#0000000#ffffff0@21
+|8| @20|╚+0#0000001#ffd7ff255|═@28|╝| +0#0000000#ffffff0@21
|9| @73
@57|1|,|1| @10|T|o|p|
diff --git a/src/testdir/dumps/Test_popupwin_title.dump b/src/testdir/dumps/Test_popupwin_title.dump
new file mode 100644
index 0000000..ae15279
--- /dev/null
+++ b/src/testdir/dumps/Test_popupwin_title.dump
@@ -0,0 +1,10 @@
+>1+0&#ffffff0| @73
+|2| @73
+|3| @73
+|4| @28| +0#0000001#ffd7ff255|T|i|t|l|e| |S|t|r|i|n|g| | +0#0000000#ffffff0@30
+|5| @28|o+0#0000001#ffd7ff255|n|e| @10| +0#0000000#ffffff0@30
+|6| @28|t+0#0000001#ffd7ff255|w|o| @10| +0#0000000#ffffff0@30
+|7| @28|a+0#0000001#ffd7ff255|n|o|t|h|e|r| @6| +0#0000000#ffffff0@30
+|8| @73
+|9| @73
+@57|1|,|1| @10|T|o|p|
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 477cda3..3f5c9d1 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -940,7 +940,7 @@
let lines =<< trim END
call setline(1, range(1, 20))
hi PopupSelected ctermbg=lightblue
- call popup_menu(['one', 'two', 'another'], {'callback': 'MenuDone'})
+ call popup_menu(['one', 'two', 'another'], {'callback': 'MenuDone', 'title': ' make a choice from the list '})
func MenuDone(id, res)
echomsg "selected " .. a:res
endfunc
@@ -960,6 +960,26 @@
call delete('XtestPopupMenu')
endfunc
+func Test_popup_title()
+ if !CanRunVimInTerminal()
+ throw 'Skipped: cannot make screendumps'
+ endif
+
+ " Create a popup without title or border, a line of padding will be added to
+ " put the title on.
+ let lines =<< trim END
+ call setline(1, range(1, 20))
+ call popup_create(['one', 'two', 'another'], {'title': 'Title String'})
+ END
+ call writefile(lines, 'XtestPopupTitle')
+ let buf = RunVimInTerminal('-S XtestPopupTitle', {'rows': 10})
+ call VerifyScreenDump(buf, 'Test_popupwin_title', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('XtestPopupTitle')
+endfunc
+
func Test_popup_close_callback()
func PopupDone(id, result)
let g:result = a:result