Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我离开插入模式时,我使用自动命令关闭预览窗口,如本答案中所述。但是当我在命令行窗口 ( q:) 中时,我得到一个错误:E11: Invalid in the command-line window; <CR> executes, CTRL-C quits: :pclose|endif
q:
E11: Invalid in the command-line window; <CR> executes, CTRL-C quits: :pclose|endif
我怎样才能防止这个错误?
我尝试:set在命令行窗口和常规窗口中运行,但没有明显的选项在差异中显示出来。
:set
用于silent!抑制错误:
silent!
autocmd CursorMovedI * if pumvisible() == 0|silent! pclose|endif autocmd InsertLeave * if pumvisible() == 0|silent! pclose|endif