Skip to content

Commit

Permalink
fix incorrect E477 #20
Browse files Browse the repository at this point in the history
BANG should be allowed for user defined cmd
  • Loading branch information
haya14busa committed Sep 17, 2016
1 parent 2fff43c commit 995ab8c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/vimlparser.vim
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ function! s:VimLParser.parse_command()
let self.ea.forceit = 0
endif

if self.ea.cmd.flags !~# '\<BANG\>' && self.ea.forceit
if self.ea.cmd.flags !~# '\<BANG\>' && self.ea.forceit && self.ea.cmd.flags !~# 'USERCMD'
throw s:Err('E477: No ! allowed', self.ea.cmdpos)
endif

Expand Down
5 changes: 5 additions & 0 deletions test/test_command.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; test_command
(excmd "normal! gg")
(excmd "normal gg")
(excmd "Usercmd x, y z 123")
(excmd "Usercmd! with bang")
5 changes: 5 additions & 0 deletions test/test_command.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
" test_command
normal! gg
normal gg
Usercmd x, y z 123
Usercmd! with bang

0 comments on commit 995ab8c

Please sign in to comment.