patch 8.2.1732: stuck when win_execute() for a popup causes an error
Problem: Stuck when win_execute() for a popup causes an error.
Solution: Disable the filter callback on error. (issue #6999)
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 6607ea2..79eaca7 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -1556,6 +1556,30 @@
call delete('XtestPopupNormal')
endfunc
+" this tests that we don't get stuck with an error in "win_execute()"
+func Test_popup_filter_win_execute()
+ CheckScreendump
+
+ let lines =<< trim END
+ let g:winid = popup_create('some text', {'filter': 'invalidfilter'})
+ call timer_start(0, {-> win_execute(g:winid, 'invalidCommand')})
+ END
+ call writefile(lines, 'XtestPopupWinExecute')
+ let buf = RunVimInTerminal('-S XtestPopupWinExecute', #{rows: 10, wait_for_ruler: 0})
+
+ call WaitFor({-> term_getline(buf, 9) =~ 'Not an editor command: invalidCommand'})
+ call term_sendkeys(buf, "\<CR>")
+ call WaitFor({-> term_getline(buf, 9) =~ 'Unknown function: invalidfilter'})
+ call term_sendkeys(buf, "\<CR>")
+ call WaitFor({-> term_getline(buf, 9) =~ 'Not allowed in a popup window'})
+ call term_sendkeys(buf, "\<CR>")
+ call term_sendkeys(buf, "\<CR>")
+ call VerifyScreenDump(buf, 'Test_popupwin_win_execute', {})
+
+ call StopVimInTerminal(buf)
+ call delete('XtestPopupWinExecute')
+endfunc
+
func ShowDialog(key, result)
let s:cb_res = 999
let winid = popup_dialog('do you want to quit (Yes/no)?', #{