Skip to content

Commit 1f8c36b

Browse files
authored
Merge pull request #28 from haya14busa/fix-incorrect-e477
fix incorrect E477
2 parents 6fce314 + 995ab8c commit 1f8c36b

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

autoload/vimlparser.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ function! s:VimLParser.parse_command()
739739
let self.ea.forceit = 0
740740
endif
741741

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

test/test_command.ok

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
; test_command
2+
(excmd "normal! gg")
3+
(excmd "normal gg")
4+
(excmd "Usercmd x, y z 123")
5+
(excmd "Usercmd! with bang")

test/test_command.vim

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
" test_command
2+
normal! gg
3+
normal gg
4+
Usercmd x, y z 123
5+
Usercmd! with bang

0 commit comments

Comments
 (0)