patch 9.1.1162: completion popup not cleared in cmdline
Problem: When an info popup spans into the cmdline area and ESC is
pressed, some content remains visible on screen (yu3s)
Solution: Add popup_overlays_cmdline() check in screen_fill() to prevent
prematurely clearing the clear_cmdline flag (glepnir).
fixes: #15627
closes: #16765
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 8b6b78f..e1041ef 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -4404,6 +4404,31 @@
" clean up
call StopVimInTerminal(buf)
+
+ let lines =<< trim END
+ set completeopt=menuone,noinsert,noselect,popup,fuzzy
+ set completepopup=border:off
+ let g:list = [
+ \ {"word": "one", "info": "one\ntwo\nthree\nfour\nfive"},
+ \ {"word": "two", "info": "one\ntwo\nthree\nfour\nfive"},
+ \ {"word": "three", "info": "one\ntwo\nthree\nfour\nfive"},
+ \ {"word": "four", "info": "one\ntwo\nthree\nfour\nfive"},
+ \ {"word": "five", "info": "one\ntwo\nthree\nfour\nfive"}
+ \ ]
+ call setline(1, repeat(['foobar'], &lines))
+ inoremap <f5> <cmd>call complete(1, g:list)<cr>
+ END
+ call writefile(lines, 'XtestPopup_win3', 'D')
+ let buf = RunVimInTerminal('-S XtestPopup_win3', #{rows: 15})
+ call term_sendkeys(buf, "Go\<F5>\<C-N>\<C-N>\<C-N>\<C-N>\<C-N>")
+ call term_wait(buf, 100)
+ call VerifyScreenDump(buf, 'Test_info_popupwin_clears_cmdline_on_hide_01', {})
+
+ call term_sendkeys(buf, "\<Esc>")
+ call term_wait(buf, 500)
+ call VerifyScreenDump(buf, 'Test_info_popupwin_clears_cmdline_on_hide_02', {})
+
+ call StopVimInTerminal(buf)
endfunc
" vim: shiftwidth=2 sts=2