patch 8.1.0554: popup menu overlaps with preview window

Problem:    Popup menu overlaps with preview window.
Solution:   Adjust the height computation. (Hirohito Higashi, closes #3414)
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index 9c25687..287d59d 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -701,6 +701,28 @@
   bw!
 endfunc
 
+func Test_popup_and_previewwindow_dump()
+  if !CanRunVimInTerminal()
+    return
+  endif
+  call writefile([
+    \ 'set previewheight=9',
+    \ 'silent! pedit',
+    \ 'call setline(1, map(repeat(["ab"], 10), "v:val. v:key"))',
+    \ 'exec "norm! G\<C-E>\<C-E>"',
+	\ ], 'Xscript')
+  let buf = RunVimInTerminal('-S Xscript', {})
+
+  " Test that popup and previewwindow do not overlap.
+  call term_sendkeys(buf, "o\<C-X>\<C-N>")
+  sleep 100m
+  call VerifyScreenDump(buf, 'Test_popup_and_previewwindow_01', {})
+
+  call term_sendkeys(buf, "\<Esc>u")
+  call StopVimInTerminal(buf)
+  call delete('Xscript')
+endfunc
+
 func Test_balloon_split()
   if !exists('*balloon_split')
     return