mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-17 23:15:47 +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:
@@ -898,6 +898,7 @@ function Events() //{{{
|
|||||||
|
|
||||||
let wasFeeding = this.feedingKeys;
|
let wasFeeding = this.feedingKeys;
|
||||||
this.feedingKeys = true;
|
this.feedingKeys = true;
|
||||||
|
this.duringFeed = this.duringFeed || "";
|
||||||
let wasSilent = commandline.silent;
|
let wasSilent = commandline.silent;
|
||||||
if (silent)
|
if (silent)
|
||||||
commandline.silent = silent;
|
commandline.silent = silent;
|
||||||
@@ -993,6 +994,15 @@ function Events() //{{{
|
|||||||
this.feedingKeys = wasFeeding;
|
this.feedingKeys = wasFeeding;
|
||||||
if (silent)
|
if (silent)
|
||||||
commandline.silent = wasSilent;
|
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;
|
return i == keys.length;
|
||||||
},
|
},
|
||||||
@@ -1370,9 +1380,9 @@ function Events() //{{{
|
|||||||
// we can differentiate between a recorded <C-c>
|
// we can differentiate between a recorded <C-c>
|
||||||
// interrupting whatever it's started and a real <C-c>
|
// interrupting whatever it's started and a real <C-c>
|
||||||
// interrupting our playback.
|
// interrupting our playback.
|
||||||
if (events.feedingKeys)
|
if (events.feedingKeys && !event.isMacro)
|
||||||
{
|
{
|
||||||
if (key == "<C-c>" && !event.isMacro)
|
if (key == "<C-c>")
|
||||||
{
|
{
|
||||||
events.feedingKeys = false;
|
events.feedingKeys = false;
|
||||||
if (modes.isReplaying)
|
if (modes.isReplaying)
|
||||||
@@ -1384,6 +1394,13 @@ function Events() //{{{
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
return true;
|
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
|
let stop = true; // set to false if we should NOT consume this event but let Firefox handle it
|
||||||
|
|||||||
Reference in New Issue
Block a user