diff src/testdir/test_popupwin.vim @ 17442:57b9fca8c7d2 v8.1.1719

patch 8.1.1719: popup too wide when 'showbreak' is set commit https://github.com/vim/vim/commit/331bafd481fddfe542099d8cccd38d240c10c011 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 20 17:46:05 2019 +0200 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 https://github.com/vim/vim/issues/4701)
author Bram Moolenaar <Bram@vim.org>
date Sat, 20 Jul 2019 18:00:07 +0200
parents 967e2ee9b656
children 8cca2654d459
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -717,6 +717,27 @@ func Test_popup_without_wrap()
   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 @@ func Test_previewpopup()
   call delete('XtestPreviewPopup')
 endfunc
 
-" vim: shiftwidth=2 sts=2 expandtab
+" vim: shiftwidth=2 sts=2