win_T *new_curwin = NULL;
tabpage_T *new_curtab = NULL;
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ {
+ emsg(_(e_cmdwin));
+ return;
+ }
+#endif
if (ARGCOUNT <= 0)
{
// Don't give an error message. We don't want it when the ":all"
// Don't let quitting the More prompt make this fail.
got_int = FALSE;
+ // Set "cmdwin_type" before any autocommands may mess things up.
+ cmdwin_type = get_cmdline_type();
+
// Create the command-line buffer empty.
if (do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL) == FAIL)
{
ga_clear(&winsizes);
return Ctrl_C;
}
- cmdwin_type = get_cmdline_type();
apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
(void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE);
call delete('.c.swp')
endfunc
+" Test for ":all" not working when in the cmdline window
+func Test_all_not_allowed_from_cmdwin()
+ au BufEnter * all
+ next x
+ call assert_fails(":norm 7q?x\<CR>", 'E11:')
+ au! BufEnter
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab