diff src/testdir/test_popupwin.vim @ 17245:13a2d3364b3f v8.1.1622

patch 8.1.1622: wrong width if displaying a lot of lines in a popup window commit https://github.com/vim/vim/commit/e296e3177b67bdcaa8b1f144d2495b9413e7055c Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 3 23:20:18 2019 +0200 patch 8.1.1622: wrong width if displaying a lot of lines in a popup window Problem: Wrong width if displaying a lot of lines in a popup window. Solution: Accurately compute the line overflow.
author Bram Moolenaar <Bram@vim.org>
date Wed, 03 Jul 2019 23:30:07 +0200
parents 3ada3d207b33
children 26e0352613ec
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -1697,3 +1697,16 @@ func Test_popupwin_with_buffer()
   redraw
   call popup_close(winid)
 endfunc
+
+func Test_popupwin_width()
+  let winid = popup_create(repeat(['short', 'long long long line', 'medium width'], 50), {
+	\ 'maxwidth': 40,
+	\ 'maxheight': 10,
+	\ })
+  for top in range(1, 20)
+    call popup_setoptions(winid, {'firstline': top})
+    redraw
+    call assert_equal(19, popup_getpos(winid).width)
+  endfor
+  call popup_clear()
+endfunc