patch 8.1.1719: popup too wide when 'showbreak' is set

Problem:    Popup too wide when 'showbreak' is set.
Solution:   Set window width when computing line length. (closes #4701)
diff --git a/src/testdir/dumps/Test_popupwin_showbreak.dump b/src/testdir/dumps/Test_popupwin_showbreak.dump
new file mode 100644
index 0000000..e7d03d0
--- /dev/null
+++ b/src/testdir/dumps/Test_popupwin_showbreak.dump
@@ -0,0 +1,10 @@
+>1+0&#ffffff0| @73
+|2| @73
+|3| @73
+|4| @25|╔+0#0000001#ffd7ff255|═@17|╗| +0#0000000#ffffff0@27
+|5| @25|║+0#0000001#ffd7ff255| |a| |l|o|n|g| |l|i|n|e| |h|e|r|e| |║| +0#0000000#ffffff0@27
+|6| @25|╚+0#0000001#ffd7ff255|═@17|╝| +0#0000000#ffffff0@27
+|7| @73
+|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 11e4323..20c175a 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -717,6 +717,27 @@
   call delete('XtestPopup')
 endfunc
 
+func Test_popup_with_showbreak()
+  if !CanRunVimInTerminal()
+    throw 'Skipped: cannot make screendumps'
+  endif
+  let lines =<< trim END
+	 set showbreak=>>\ 
+	 call setline(1, range(1, 20))
+	 let winid = popup_dialog(
+	   \ 'a long line here',
+	   \ #{filter: 'popup_filter_yesno'})
+  END
+  call writefile(lines, 'XtestPopupShowbreak')
+  let buf = RunVimInTerminal('-S XtestPopupShowbreak', #{rows: 10})
+  call VerifyScreenDump(buf, 'Test_popupwin_showbreak', {})
+
+  " clean up
+  call term_sendkeys(buf, "y")
+  call StopVimInTerminal(buf)
+  call delete('XtestPopupShowbreak')
+endfunc
+
 func Test_popup_time()
   if !has('timers')
     throw 'Skipped: timer feature not supported'
@@ -2162,4 +2183,4 @@
   call delete('XtestPreviewPopup')
 endfunc
 
-" vim: shiftwidth=2 sts=2 expandtab
+" vim: shiftwidth=2 sts=2