1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-30 22:12:27 +01:00

Allow argument to :w

This commit is contained in:
Kris Maglione
2008-10-12 20:08:51 +00:00
parent 0f92110012
commit 99f3e3cfef
5 changed files with 59 additions and 26 deletions

View File

@@ -535,6 +535,27 @@ liberator.Events = function () //{{{
}
}
function wrapListener(method)
{
return function (event)
{
try
{
liberator.dump(event);
eventManager[method](event);
}
catch (e)
{
if (e.message == "Interrupted")
liberator.echoerr("Interrupted");
else
liberator.echoerr("Processing " + event.type + " event: " + (e.echoerr || e));
if (Components.utils.reportError)
Components.utils.reportError(e);
}
}
}
// return true when load successful, or false otherwise
function waitForPageLoaded()
{
@@ -1195,6 +1216,13 @@ liberator.Events = function () //{{{
}
}
if (key == "<C-c>")
liberator.interrupted = true;
// feedingKeys needs to be separate from interrupted so
// we can differentiate between a recorded <C-c>
// interrupting whatever it's started and a real <C-c>
// interrupting our playback.
if (liberator.events.feedingKeys)
{
if (key == "<C-c>" && !event.isMacro)
@@ -1207,9 +1235,6 @@ liberator.Events = function () //{{{
}
}
if (key == "<C-c>")
liberator.interrupted = true;
var stop = true; // set to false if we should NOT consume this event but let Firefox handle it
var win = document.commandDispatcher.focusedWindow;
@@ -1611,9 +1636,9 @@ liberator.Events = function () //{{{
eventManager.prefObserver.unregister();
});
window.addEventListener("keypress", eventManager.onKeyPress, true);
window.addEventListener("keydown", eventManager.onKeyUpOrDown, true);
window.addEventListener("keyup", eventManager.onKeyUpOrDown, true);
window.addEventListener("keypress", wrapListener("onKeyPress"), true);
window.addEventListener("keydown", wrapListener("onKeyUpOrDown"), true);
window.addEventListener("keyup", wrapListener("onKeyUpOrDown"), true);
return eventManager;