From bbadc27667200452ccabc62bbb9b97bd47e23a34 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 26 Jan 2011 16:28:28 -0500 Subject: [PATCH] Fix macro playback with counts. Closes issue #294. --HG-- branch : key-processing --- common/content/events.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/common/content/events.js b/common/content/events.js index 7bd715ae..0e8d253a 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -451,15 +451,13 @@ var Events = Module("events", { this._lastMacro = macro.toLowerCase(); // XXX: sets last played macro, even if it does not yet exist if (this._macros.get(this._lastMacro)) { - // make sure the page is stopped before starting to play the macro try { - window.getWebNavigation().stop(nsIWebNavigation.STOP_ALL); + modes.replaying = true; + res = events.feedkeys(this._macros.get(this._lastMacro).keys, { noremap: true }); + } + finally { + modes.replaying = false; } - catch (e) {} - - modes.replaying = true; - res = events.feedkeys(this._macros.get(this._lastMacro).keys, { noremap: true }); - modes.replaying = false; } else // TODO: ignore this like Vim? @@ -537,7 +535,7 @@ var Events = Module("events", { } if (!this.feedingKeys) - break; + return false; } } catch (e) { @@ -549,6 +547,7 @@ var Events = Module("events", { if (quiet) commandline.quiet = wasQuiet; } + return true; }, /**