From 5a00fb0c62b2e922f7fdc8c359dbbe8d5a0875df Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 5 Feb 2011 08:46:35 -0500 Subject: [PATCH] Make :rehash|echomsg "foo" work as expected. --HG-- branch : groups --- common/content/autocommands.js | 2 +- common/content/commands.js | 2 ++ common/content/dactyl.js | 11 ++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/common/content/autocommands.js b/common/content/autocommands.js index 05f17678..76a45a41 100644 --- a/common/content/autocommands.js +++ b/common/content/autocommands.js @@ -78,7 +78,7 @@ var AutoCommands = Module("autocommands", { hives: Group.SubGroup("autocmd", AutoCmdHive), - get activeHives() contexts.activeGroups("autocmd").map(function (h) h.autocmd), + get activeHives() contexts.activeGroups("autocmd").map(function (h) h.autocmd).filter(function (h) h._store.length), add: deprecated("autocommand.user.add", { get: function add() autocommands.user.closure.add }), get: deprecated("autocommand.user.get", { get: function get() autocommands.user.closure.get }), diff --git a/common/content/commands.js b/common/content/commands.js index 3c1a66fb..28a749d4 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -1090,6 +1090,8 @@ var Commands = Module("commands", { args.commandString = str.substr(0, len) + args.string; str = args.trailing; yield [command, args]; + if (args.break) + break; } while (str); }, diff --git a/common/content/dactyl.js b/common/content/dactyl.js index e889769c..5623eb17 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1791,7 +1791,12 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { commands.add(["reh[ash]"], "Reload the " + config.appName + " add-on", - function (args) { util.rehash(args); }, + function (args) { + if (args.trailing) + JSMLoader.rehashCmd = args.trailing; // Hack. + args.break = true; + util.rehash(args); + }, { argCount: "0", options: [ @@ -2117,6 +2122,10 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { dactyl.execute(cmd); }); + if (JSMLoader.rehashCmd) + dactyl.execute(JSMLoader.rehashCmd); + JSMLoader.rehashCmd = null; + dactyl.fullyInitialized = true; dactyl.triggerObserver("enter", null); autocommands.trigger("Enter", {});