diff --git a/content/events.js b/content/events.js index 5a8e66ff..24431adb 100644 --- a/content/events.js +++ b/content/events.js @@ -734,8 +734,6 @@ liberator.Events = function () //{{{ if (macros.get(lastMacro)) { - liberator.modes.isReplaying = true; - // make sure the page is stopped before starting to play the macro try { @@ -745,7 +743,6 @@ liberator.Events = function () //{{{ liberator.buffer.loaded = 1; // even if not a full page load, assume it did load correctly before starting the macro res = liberator.events.feedkeys(macros.get(lastMacro), true); // true -> noremap - liberator.modes.isReplaying = false; } else { @@ -797,6 +794,8 @@ liberator.Events = function () //{{{ var charCode = keys.charCodeAt(i); var keyCode = 0; var shift = false, ctrl = false, alt = false, meta = false; + + liberator.modes.isReplaying = true; //if (charCode == 92) // the '\' key FIXME: support the escape key if (charCode == 60 && !escapeKey) // the '<' key starts a complex key { @@ -826,7 +825,7 @@ liberator.Events = function () //{{{ } else // an invalid key like was found, stop propagation here (like Vim) { - return false; + break; } i += matches[0].length + 1; @@ -848,13 +847,14 @@ liberator.Events = function () //{{{ elem.dispatchEvent(evt); // stop feeding keys if page loading failed if (!liberator.modes.isReplaying) - return false; + break; if (!waitForPageLoaded()) - return false; + break; // else // a short break between keys often helps // liberator.sleep(50); } - return true; + liberator.modes.isReplaying = false; + return i == keys.length; }, // this function converts the given event to