patch 8.1.1518: crash when setting 'columns' while a popup is visible
Problem: Crash when setting 'columns' while a popup is visible.
Solution: Recompute all positions when clearing the screen. (closes #4467)
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 51eed30..06a33d4 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -41,6 +41,12 @@
call term_sendkeys(buf, ":quit!\<CR>")
call VerifyScreenDump(buf, 'Test_popupwin_04', {})
+ " set 'columns' to a small value, size must be recomputed
+ call term_sendkeys(buf, ":let cols = &columns\<CR>")
+ call term_sendkeys(buf, ":set columns=12\<CR>")
+ call VerifyScreenDump(buf, 'Test_popupwin_04a', {})
+ call term_sendkeys(buf, ":let &columns = cols\<CR>")
+
" resize popup, show empty line at bottom
call term_sendkeys(buf, ":call popup_move(popupwin, {'minwidth': 15, 'maxwidth': 25, 'minheight': 3, 'maxheight': 5})\<CR>")
call term_sendkeys(buf, ":redraw\<CR>")