summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-02-10 23:45:39 -0500
committerKris Maglione <maglione.k@gmail.com>2011-02-10 23:45:39 -0500
commit43a27346bdbf318c0eefb7e02e87abe65377a076 (patch)
tree6f99ae61191a8e3287ff99f80127bc095c3b1bd2
parent30e29714247c58dc011bbf69a31cef9450fb8f9d (diff)
downloadpentadactyl-43a27346bdbf318c0eefb7e02e87abe65377a076.tar.gz
Fix bugs yay.
--HG-- branch : groups
-rw-r--r--common/content/browser.js4
-rw-r--r--common/content/mappings.js8
-rw-r--r--common/modules/base.jsm2
-rw-r--r--common/modules/contexts.jsm13
-rw-r--r--common/modules/overlay.jsm4
5 files changed, 20 insertions, 11 deletions
diff --git a/common/content/browser.js b/common/content/browser.js
index dc3afd88..3bda8cc3 100644
--- a/common/content/browser.js
+++ b/common/content/browser.js
@@ -105,6 +105,10 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
// only thrown for the current tab, not when another tab changes
if (flags & Ci.nsIWebProgressListener.STATE_START) {
statusline.progress = 0;
+ while (document.commandDispatcher.focusedWindow == webProgress.DOMWindow
+ && modes.have(modes.INPUT))
+ modes.pop();
+
}
else if (flags & Ci.nsIWebProgressListener.STATE_STOP) {
// Workaround for bugs 591425 and 606877, dactyl bug #81
diff --git a/common/content/mappings.js b/common/content/mappings.js
index 5ab10f3c..35978537 100644
--- a/common/content/mappings.js
+++ b/common/content/mappings.js
@@ -387,7 +387,7 @@ var Mappings = Module("mappings", {
* @param {string} filter The filter string to match.
*/
list: function (modes, filter, hives) {
- hives = hives || mappings.userHives;
+ hives = (hives || mappings.userHives).filter(function (h) modes.some(function (m) h.getStack(m).length));
let modeSign = "";
modes.filter(function (m) m.char).forEach(function (m) { modeSign += m.char; });
@@ -410,12 +410,12 @@ var Mappings = Module("mappings", {
</tr>
<col style="min-width: 6em; padding-right: 1em;"/>
{
- template.map(hives, function (hive)
+ template.map(hives, function (hive) let (i = 0)
<tr style="height: .5ex;"/> +
template.map(maps(hive), function (map)
- template.map(map.names, function (name, i)
+ template.map(map.names, function (name)
<tr>
- <td highlight="Title">{!i ? hive.name : ""}</td>
+ <td highlight="Title">{!i++ ? hive.name : ""}</td>
<td>{modeSign}</td>
<td>{name}</td>
<td>{map.rhs || map.action.toSource()}</td>
diff --git a/common/modules/base.jsm b/common/modules/base.jsm
index 56d86a3b..698c5505 100644
--- a/common/modules/base.jsm
+++ b/common/modules/base.jsm
@@ -1017,7 +1017,7 @@ var Timer = Class("Timer", {
notify: function (timer, force) {
try {
- if (loaded.util && util.rehashing || typeof util === "undefined" || !force && this.doneAt == 0)
+ if (!loaded || loaded.util && util.rehashing || typeof util === "undefined" || !force && this.doneAt == 0)
return;
this._timer.cancel();
diff --git a/common/modules/contexts.jsm b/common/modules/contexts.jsm
index 98c130fa..75f271e5 100644
--- a/common/modules/contexts.jsm
+++ b/common/modules/contexts.jsm
@@ -80,14 +80,16 @@ var Contexts = Module("contexts", {
const contexts = this;
this.modules = modules;
+ modules.plugins.contexts = {};
+
this.groupList = [];
this.groupMap = {};
this.groupsProto = {};
this.hives = {};
this.hiveProto = {};
- this.user = this.addGroup("user", "User-defined items", null, true);
this.builtin = this.addGroup("builtin", "Builtin items");
+ this.user = this.addGroup("user", "User-defined items", null, true);
this.builtinGroups = [this.builtin, this.user];
this.builtin.modifiable = false;
@@ -122,8 +124,8 @@ var Contexts = Module("contexts", {
for (let hive in values(this.groupList))
util.trapErrors("destroy", hive);
- for (let plugin in values(plugins.contexts))
- if (plugin.onUnload)
+ for (let [name, plugin] in iter(this.modules.plugins.contexts))
+ if (plugin && "onUnload" in plugin)
util.trapErrors("onUnload", plugin);
},
@@ -360,8 +362,9 @@ var Contexts = Module("contexts", {
action.macro = util.compileMacro(rhs, true);
break;
case "-ex":
- action = function action() commands.execute(action.macro, makeParams(this, arguments),
- false, null, action.context);
+ action = function action() this.modules.commands
+ .execute(action.macro, makeParams(this, arguments),
+ false, null, action.context);
action.macro = util.compileMacro(rhs, true);
action.context = this.context && update({}, this.context);
break;
diff --git a/common/modules/overlay.jsm b/common/modules/overlay.jsm
index fe8ea1fd..6bf393c0 100644
--- a/common/modules/overlay.jsm
+++ b/common/modules/overlay.jsm
@@ -296,8 +296,10 @@ var Overlay = Module("Overlay", {
frob("init");
defineModule.modules.forEach(function ({ lazyInit, constructor: { className } }) {
- if (!lazyInit)
+ if (!lazyInit) {
frob(className);
+ modules[className] = modules[className];
+ }
else
modules.__defineGetter__(className, function () {
delete modules[className];