1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-05 08:35:46 +01:00

Fix #180. User can no-longer interrupt macros.

Buffers any keystrokes recieved during a macro expansion and plays them
after it has finished.
This commit is contained in:
Conrad Irwin
2009-03-26 02:48:55 +00:00
parent d6238f84a4
commit bda0c5bda5

View File

@@ -898,6 +898,7 @@ function Events() //{{{
let wasFeeding = this.feedingKeys;
this.feedingKeys = true;
this.duringFeed = this.duringFeed || "";
let wasSilent = commandline.silent;
if (silent)
commandline.silent = silent;
@@ -993,6 +994,15 @@ function Events() //{{{
this.feedingKeys = wasFeeding;
if (silent)
commandline.silent = wasSilent;
if (this.duringFeed != "")
{
//Create a scalar constant for closure.
let duringFeed = this.duringFeed;
this.duringFeed = "";
setTimeout(function () events.feedkeys(duringFeed, false, false, true), 0);
}
}
return i == keys.length;
},
@@ -1370,9 +1380,9 @@ function Events() //{{{
// we can differentiate between a recorded <C-c>
// interrupting whatever it's started and a real <C-c>
// interrupting our playback.
if (events.feedingKeys)
if (events.feedingKeys && !event.isMacro)
{
if (key == "<C-c>" && !event.isMacro)
if (key == "<C-c>")
{
events.feedingKeys = false;
if (modes.isReplaying)
@@ -1384,6 +1394,13 @@ function Events() //{{{
event.stopPropagation();
return true;
}
else
{
events.duringFeed += key;
event.preventDefault();
event.stopPropagation();
return true;
}
}
let stop = true; // set to false if we should NOT consume this event but let Firefox handle it