Case-sensitive validation of on arguments (#314)

This commit is contained in:
Junegunn Choi 2015-11-15 22:43:25 +09:00
parent 0c710f75f4
commit 38e1e6335c

View file

@ -175,11 +175,14 @@ function! plug#end()
call s:assoc(lod.map, cmd, name) call s:assoc(lod.map, cmd, name)
endif endif
call add(s:triggers[name].map, cmd) call add(s:triggers[name].map, cmd)
elseif cmd =~ '^[A-Z]' elseif cmd =~# '^[A-Z]'
if exists(':'.cmd) != 2 if exists(':'.cmd) != 2
call s:assoc(lod.cmd, cmd, name) call s:assoc(lod.cmd, cmd, name)
endif endif
call add(s:triggers[name].cmd, cmd) call add(s:triggers[name].cmd, cmd)
else
call s:err('Invalid `on` option: '.cmd.
\ '. Should start with an uppercase letter or `<Plug>`.')
endif endif
endfor endfor
endif endif