mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-10-21 11:35:43 +02:00
Validate the pattern arg to :autocmd.
This commit is contained in:
1 parent
76a096e36b
commit
c51761e08b
1 file changed
+10
-1
@@ -70,7 +70,16 @@ function AutoCommands() //{{{
|
|||||||
function (args)
|
function (args)
|
||||||
{
|
{
|
||||||
let [event, regex, cmd] = args;
|
let [event, regex, cmd] = args;
|
||||||
let events = null;
|
let events = [];
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
RegExp(regex);
|
||||||
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
return void liberator.echoerr("E475: Invalid argument: " + regex);
|
||||||
|
}
|
||||||
|
|
||||||
if (event)
|
if (event)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user