diff src/testdir/test_popupwin.vim @ 23936:a0e02766e06d v8.2.2510

patch 8.2.2510: internal error when popup with mask is zero height or width Commit: https://github.com/vim/vim/commit/10ccfb2a17e736ace054b19dc712544b4e961671 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 13 21:31:18 2021 +0100 patch 8.2.2510: internal error when popup with mask is zero height or width Problem: Internal error when popup with mask is zero height or width. Solution: Bail out if width or height is zero. (closes https://github.com/vim/vim/issues/7831)
author Bram Moolenaar <Bram@vim.org>
date Sat, 13 Feb 2021 21:45:05 +0100
parents 3033dade50ca
children 0967c54ff3b2
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -825,6 +825,25 @@ func Test_popup_with_mask()
   " this was causing a crash
   call popup_create('test', #{mask: [[0, 0, 0, 0]]})
   call popup_clear()
+
+  " this was causing an internal error
+  enew
+  set nowrap
+  call repeat('x', &columns)->setline(1)
+  call prop_type_add('textprop', {})
+  call prop_add(1, 1, #{length: &columns, type: 'textprop'})
+  vsplit
+  let opts = popup_create('', #{textprop: 'textprop'})
+	\ ->popup_getoptions()
+	\ ->extend(#{mask: [[1, 1, 1, 1]]})
+  call popup_create('', opts)
+  redraw
+
+  close!
+  bwipe!
+  call prop_type_delete('textprop')
+  call popup_clear()
+  set wrap&
 endfunc
 
 func Test_popup_select()