I use an autocommand to close the preview window when I leave insert mode as described in this answer. But when I am in the command-line window (q:
), I get an error: E11: Invalid in the command-line window; <CR> executes, CTRL-C quits: :pclose|endif
How can I prevent this error?
I tried running :set
in the command-line window and a regular window, but no obvious option revealed itself in the diff.