diff --git a/common/content/buffer.js b/common/content/buffer.js index 6d3c93fa..eb84f668 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -1756,6 +1756,11 @@ var Buffer = Module("buffer", { if (isinstance(services.focus.activeWindow.document.activeElement, [HTMLInputElement, HTMLButtonElement, Ci.nsIDOMXULButtonElement])) return Events.PASS; + + if (isinstance(buffer.focusedFrame.document.activeElement, + [HTMLInputElement, HTMLButtonElement, Ci.nsIDOMXULButtonElement])) + return Events.PASS; + buffer.scrollVertical("pages", Math.max(args.count, 1)); }, { count: true }); diff --git a/common/modules/io.jsm b/common/modules/io.jsm index 63ac6061..9b22b528 100644 --- a/common/modules/io.jsm +++ b/common/modules/io.jsm @@ -170,6 +170,9 @@ var IO = Module("io", { if (/\.js$/.test(filename)) { try { var context = contexts.Script(file, params.group); + if (Set.has(this._scriptNames, file.path)) + util.flushCache(); + dactyl.loadScript(uri.spec, context); dactyl.helpInitialized = false; } @@ -198,8 +201,7 @@ var IO = Module("io", { }); } - if (this._scriptNames.indexOf(file.path) == -1) - this._scriptNames.push(file.path); + Set.add(this._scriptNames, file.path); dactyl.echomsg(_("io.sourcingEnd", filename.quote()), 2); dactyl.log(_("dactyl.sourced", filename), 3); @@ -780,12 +782,13 @@ unlet s:cpo_save commands.add(["scrip[tnames]"], "List all sourced script names", function () { - if (!io._scriptNames.length) + let names = Object.keys(io._scriptNames); + if (!names.length) dactyl.echomsg(_("command.scriptnames.none")); else modules.commandline.commandOutput( template.tabular(["", "Filename"], ["text-align: right; padding-right: 1em;"], - ([i + 1, file] for ([i, file] in Iterator(io._scriptNames))))); + ([i + 1, file] for ([i, file] in Iterator(names))))); }, { argCount: "0" }); diff --git a/common/modules/util.jsm b/common/modules/util.jsm index 7941ebf5..d9727442 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -1652,6 +1652,13 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), }()) }), + /** + * Flushes the startup cache. + */ + flushCache: function flushCache() { + services.observer.notifyObservers(null, "startupcache-invalidate", ""); + }, + /** * Reloads dactyl in entirety by disabling the add-on and * re-enabling it. @@ -1659,7 +1666,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), rehash: function (args) { storage.session.commandlineArgs = args; this.timeout(function () { - services.observer.notifyObservers(null, "startupcache-invalidate", ""); + this.flushCache(); this.rehashing = true; let addon = config.addon; addon.userDisabled = true;