aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/arglist.c4
-rw-r--r--src/nvim/testdir/test_arglist.vim16
2 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/arglist.c b/src/nvim/arglist.c
index 02e3a99aab..f22ef10e3f 100644
--- a/src/nvim/arglist.c
+++ b/src/nvim/arglist.c
@@ -782,6 +782,10 @@ static void do_arg_all(int count, int forceit, int keep_tabs)
assert(firstwin != NULL); // satisfy coverity
+ if (cmdwin_type != 0) {
+ emsg(_(e_cmdwin));
+ return;
+ }
if (ARGCOUNT <= 0) {
// Don't give an error message. We don't want it when the ":all" command is in the .vimrc.
return;
diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim
index 521c3fcd57..19b64f996c 100644
--- a/src/nvim/testdir/test_arglist.vim
+++ b/src/nvim/testdir/test_arglist.vim
@@ -591,4 +591,20 @@ func Test_quit_with_arglist()
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
+ " Use try/catch here, somehow assert_fails() doesn't work on MS-Windows
+ " console.
+ let caught = 'no'
+ try
+ exe ":norm! 7q?apat\<CR>"
+ catch /E11:/
+ let caught = 'yes'
+ endtry
+ call assert_equal('yes', caught)
+ au! BufEnter
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab