patch 8.2.2893: multi-byte text in popup title shows up wrong
Problem: Multi-byte text in popup title shows up wrong.
Solution: Use the character width instead of the byte length. (Ralf Schandl,
closes #8267, closes #8264)
diff --git a/src/testdir/dumps/Test_popupwin_multibytetitle.dump b/src/testdir/dumps/Test_popupwin_multibytetitle.dump
new file mode 100644
index 0000000..e21c0cf
--- /dev/null
+++ b/src/testdir/dumps/Test_popupwin_multibytetitle.dump
@@ -0,0 +1,10 @@
+>1+0&#ffffff0| @73
+|2| @73
+|3| @73
+|4| @25|╔+0#0000001#ffd7ff255|▶|Ä|Ö|Ü|◀|═@12|╗| +0#0000000#ffffff0@27
+|5| @25|║+0#0000001#ffd7ff255| |T+0&#e0e0e08|h|i|s| |i|s| |a| |l|i|n|e| @1| +0&#ffd7ff255|║| +0#0000000#ffffff0@27
+|6| @25|║+0#0000001#ffd7ff255| |a|n|d| |a|n|o|t|h|e|r| |l|i|n|e| |║| +0#0000000#ffffff0@27
+|7| @25|╚+0#0000001#ffd7ff255|═@17|╝| +0#0000000#ffffff0@27
+|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 f13252b..13957e5 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -1799,6 +1799,11 @@
call term_sendkeys(buf, ":\<CR>")
call VerifyScreenDump(buf, 'Test_popupwin_longtitle_4', {})
+ call term_sendkeys(buf, ":call popup_clear()\<CR>")
+ call term_sendkeys(buf, ":call popup_menu(['This is a line', 'and another line'], #{title: '▶ÄÖÜ◀', })\<CR>")
+ call VerifyScreenDump(buf, 'Test_popupwin_multibytetitle', {})
+ call term_sendkeys(buf, "x")
+
" clean up
call StopVimInTerminal(buf)
call delete('XtestPopupTitle')