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/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", {})