diff options
author | Doug Kearns <dougkearns@gmail.com> | 2011-07-21 01:39:40 +1000 |
---|---|---|
committer | Doug Kearns <dougkearns@gmail.com> | 2011-07-21 01:39:40 +1000 |
commit | 96469e9f473d55bf26d528b6c511162a6029afc6 (patch) | |
tree | 18e74889dd08b3f35d47f149eb484fa51a21b317 /common/content/autocommands.js | |
parent | 55a403b5caa21a6cea1bf1a7ad6b7a2fed7ea94e (diff) | |
download | pentadactyl-96469e9f473d55bf26d528b6c511162a6029afc6.tar.gz |
Add group filtering to :command and :autocommand listings.
Diffstat (limited to 'common/content/autocommands.js')
-rw-r--r-- | common/content/autocommands.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/common/content/autocommands.js b/common/content/autocommands.js index 869c0cf8..ed5d5b04 100644 --- a/common/content/autocommands.js +++ b/common/content/autocommands.js @@ -84,12 +84,17 @@ var AutoCommands = Module("autocommands", { remove: deprecated("group.autocmd.remove", { get: function remove() autocommands.user.closure.remove }), /** - * Lists all autocommands with a matching *event* and *regexp*. + * Lists all autocommands with a matching *event*, *regexp* and optionally + * *hives*. * * @param {string} event The event name filter. * @param {string} regexp The URL pattern filter. + * @param {Hive[]} hives List of hives. + * @optional */ - list: function (event, regexp) { + list: function (event, regexp, hives) { + + let hives = hives || this.activeHives; function cmds(hive) { let cmds = {}; @@ -108,7 +113,7 @@ var AutoCommands = Module("autocommands", { <td colspan="3">----- Auto Commands -----</td> </tr> { - template.map(this.activeHives, function (hive) + template.map(hives, function (hive) <tr highlight="Title"> <td colspan="3">{hive.name}</td> </tr> + @@ -200,7 +205,7 @@ var AutoCommands = Module("autocommands", { args["-group"].remove(event, regexp); // remove all } else - autocommands.list(event, regexp); // list all + autocommands.list(event, regexp, args.explicitOpts["-group"] ? [args["-group"]] : null); // list all } }, { bang: true, |