patch 8.1.1527: when moving popup window over the cmdline it is not redrawn

Problem:    When moving a popup window over the command line it is not
            redrawn.
Solution:   Redraw the command line. Move popup redrawing code to the popupwin
            file.
diff --git a/src/testdir/dumps/Test_popupwin_drag_01.dump b/src/testdir/dumps/Test_popupwin_drag_01.dump
new file mode 100644
index 0000000..e47fbc4
--- /dev/null
+++ b/src/testdir/dumps/Test_popupwin_drag_01.dump
@@ -0,0 +1,10 @@
+>1+0&#ffffff0| @73
+|2| @73
+|3| @73
+|4| @73
+|5| @73
+|6| @32|╔+0#0000001#ffd7ff255|═@5|╗| +0#0000000#ffffff0@32
+|7| @32|║+0#0000001#ffd7ff255|1@3| @1|║| +0#0000000#ffffff0@32
+|8| @32|║+0#0000001#ffd7ff255|2@5|║| +0#0000000#ffffff0@32
+|9| @32|║+0#0000001#ffd7ff255|3@4| |║| +0#0000000#ffffff0@32
+@34|╚+0#0000001#ffd7ff255|═@5|╝| +0#0000000#ffffff0@14|1|,|1| @10|T|o|p| 
diff --git a/src/testdir/dumps/Test_popupwin_drag_02.dump b/src/testdir/dumps/Test_popupwin_drag_02.dump
new file mode 100644
index 0000000..7e8c30e
--- /dev/null
+++ b/src/testdir/dumps/Test_popupwin_drag_02.dump
@@ -0,0 +1,10 @@
+>1+0&#ffffff0| @73
+|2| @32|╔+0#0000001#ffd7ff255|═@5|╗| +0#0000000#ffffff0@32
+|3| @32|║+0#0000001#ffd7ff255|1@3| @1|║| +0#0000000#ffffff0@32
+|4| @32|║+0#0000001#ffd7ff255|2@5|║| +0#0000000#ffffff0@32
+|5| @32|║+0#0000001#ffd7ff255|3@4| |║| +0#0000000#ffffff0@32
+|6| @32|╚+0#0000001#ffd7ff255|═@5|╝| +0#0000000#ffffff0@32
+|7| @73
+|8| @73
+|9| @73
+@57|1|,|1| @10|T|o|p| 
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 6def8e4..c084c7c 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -289,6 +289,36 @@
   call delete('XtestPopupFirstline')
 endfunc
 
+func Test_popup_drag()
+  if !CanRunVimInTerminal()
+    throw 'Skipped: cannot make screendumps'
+  endif
+  " create a popup that covers the command line
+  let lines =<< trim END
+	call setline(1, range(1, 20))
+	let winid = popup_create(['1111', '222222', '33333'], {
+	      \ 'drag': 1,
+	      \ 'border': [],
+	      \ 'line': &lines - 4,
+	      \ })
+	func Dragit()
+	  call feedkeys("\<F3>\<LeftMouse>\<F4>\<LeftDrag>\<LeftRelease>", "xt")
+	endfunc
+	map <silent> <F3> :call test_setmouse(&lines - 4, &columns / 2)<CR>
+	map <silent> <F4> :call test_setmouse(&lines - 8, &columns / 2)<CR>
+  END
+  call writefile(lines, 'XtestPopupDrag')
+  let buf = RunVimInTerminal('-S XtestPopupDrag', {'rows': 10})
+  call VerifyScreenDump(buf, 'Test_popupwin_drag_01', {})
+
+  call term_sendkeys(buf, ":call Dragit()\<CR>")
+  call VerifyScreenDump(buf, 'Test_popupwin_drag_02', {})
+
+  " clean up
+  call StopVimInTerminal(buf)
+  call delete('XtestPopupDrag')
+endfunc
+
 func Test_popup_in_tab()
   " default popup is local to tab, not visible when in other tab
   let winid = popup_create("text", {})