mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-13 11:05:45 +01:00
Validate the pattern arg to :autocmd.
This commit is contained in:
@@ -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