diff --git a/autoload/vimlparser.vim b/autoload/vimlparser.vim index c7cc2d6..1aaa9e0 100644 --- a/autoload/vimlparser.vim +++ b/autoload/vimlparser.vim @@ -739,7 +739,7 @@ function! s:VimLParser.parse_command() let self.ea.forceit = 0 endif - if self.ea.cmd.flags !~# '\' && self.ea.forceit + if self.ea.cmd.flags !~# '\' && self.ea.forceit && self.ea.cmd.flags !~# 'USERCMD' throw s:Err('E477: No ! allowed', self.ea.cmdpos) endif diff --git a/test/test_command.ok b/test/test_command.ok new file mode 100644 index 0000000..415661e --- /dev/null +++ b/test/test_command.ok @@ -0,0 +1,5 @@ +; test_command +(excmd "normal! gg") +(excmd "normal gg") +(excmd "Usercmd x, y z 123") +(excmd "Usercmd! with bang") diff --git a/test/test_command.vim b/test/test_command.vim new file mode 100644 index 0000000..65d8eb4 --- /dev/null +++ b/test/test_command.vim @@ -0,0 +1,5 @@ +" test_command +normal! gg +normal gg +Usercmd x, y z 123 +Usercmd! with bang