mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 03:47:58 +01:00
Fix command shadow
This commit is contained in:
@@ -182,7 +182,7 @@ const modes = (function () //{{{
|
|||||||
// if a main mode is set, the extended is always cleared
|
// if a main mode is set, the extended is always cleared
|
||||||
if (typeof mainMode === "number")
|
if (typeof mainMode === "number")
|
||||||
{
|
{
|
||||||
if (!silent && mainMode != main)
|
if (mainMode != main)
|
||||||
handleModeChange(main, mainMode);
|
handleModeChange(main, mainMode);
|
||||||
|
|
||||||
main = mainMode;
|
main = mainMode;
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ function CommandLine() //{{{
|
|||||||
var lastMowOutput = null;
|
var lastMowOutput = null;
|
||||||
|
|
||||||
var silent = false;
|
var silent = false;
|
||||||
|
var keepCommand = false;
|
||||||
|
|
||||||
function Completions(context)
|
function Completions(context)
|
||||||
{
|
{
|
||||||
@@ -363,7 +364,9 @@ function CommandLine() //{{{
|
|||||||
var promptChangeCallback = null;
|
var promptChangeCallback = null;
|
||||||
var promptCompleter = null;
|
var promptCompleter = null;
|
||||||
|
|
||||||
liberator.registerCallback("submit", modes.EX, function (command) { liberator.execute(command); });
|
liberator.registerCallback("submit", modes.EX, function (command) {
|
||||||
|
liberator.execute(command);
|
||||||
|
});
|
||||||
liberator.registerCallback("complete", modes.EX, function (context) {
|
liberator.registerCallback("complete", modes.EX, function (context) {
|
||||||
context.fork("ex", 0, completion, "ex");
|
context.fork("ex", 0, completion, "ex");
|
||||||
});
|
});
|
||||||
@@ -824,6 +827,7 @@ function CommandLine() //{{{
|
|||||||
currentPrompt = prompt || "";
|
currentPrompt = prompt || "";
|
||||||
currentCommand = cmd || "";
|
currentCommand = cmd || "";
|
||||||
currentExtendedMode = extendedMode || null;
|
currentExtendedMode = extendedMode || null;
|
||||||
|
keepCommand = false;
|
||||||
|
|
||||||
historyIndex = UNINITIALIZED;
|
historyIndex = UNINITIALIZED;
|
||||||
|
|
||||||
@@ -855,6 +859,8 @@ function CommandLine() //{{{
|
|||||||
liberator.focusContent(false);
|
liberator.focusContent(false);
|
||||||
|
|
||||||
this.clear();
|
this.clear();
|
||||||
|
liberator.dump("keepCommand: " + keepCommand);
|
||||||
|
keepCommand = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
clear: function clear()
|
clear: function clear()
|
||||||
@@ -864,6 +870,7 @@ function CommandLine() //{{{
|
|||||||
completionList.hide();
|
completionList.hide();
|
||||||
this.resetCompletions();
|
this.resetCompletions();
|
||||||
|
|
||||||
|
if (!keepCommand || this.silent)
|
||||||
setLine("", this.HL_NORMAL);
|
setLine("", this.HL_NORMAL);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -993,8 +1000,9 @@ function CommandLine() //{{{
|
|||||||
if (events.isAcceptKey(key))
|
if (events.isAcceptKey(key))
|
||||||
{
|
{
|
||||||
let mode = currentExtendedMode; // save it here, as modes.pop() resets it
|
let mode = currentExtendedMode; // save it here, as modes.pop() resets it
|
||||||
|
keepCommand = (mode == modes.EX); // Fixme.
|
||||||
currentExtendedMode = null; /* Don't let modes.pop trigger "cancel" */
|
currentExtendedMode = null; /* Don't let modes.pop trigger "cancel" */
|
||||||
modes.pop();
|
modes.pop(!this.silent);
|
||||||
|
|
||||||
return liberator.triggerCallback("submit", mode, command);
|
return liberator.triggerCallback("submit", mode, command);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user