mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-29 22:15:47 +01:00
Push too-long echoed lines to the MOW.
This commit is contained in:
@@ -126,6 +126,7 @@ function CommandLine() //{{{
|
|||||||
var promptWidget = document.getElementById("liberator-commandline-prompt");
|
var promptWidget = document.getElementById("liberator-commandline-prompt");
|
||||||
// the command bar which contains the current command
|
// the command bar which contains the current command
|
||||||
var commandWidget = document.getElementById("liberator-commandline-command");
|
var commandWidget = document.getElementById("liberator-commandline-command");
|
||||||
|
commandWidget.inputField.QueryInterface(Components.interfaces.nsIDOMNSEditableElement);
|
||||||
|
|
||||||
// the widget used for multiline output
|
// the widget used for multiline output
|
||||||
var multilineOutputWidget = document.getElementById("liberator-multiline-output");
|
var multilineOutputWidget = document.getElementById("liberator-multiline-output");
|
||||||
@@ -203,11 +204,18 @@ function CommandLine() //{{{
|
|||||||
commandWidget.value = cmd;
|
commandWidget.value = cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setLine(str, highlightGroup)
|
function setLine(str, highlightGroup, forceSingle)
|
||||||
{
|
{
|
||||||
setHighlightGroup(highlightGroup);
|
setHighlightGroup(highlightGroup);
|
||||||
setPrompt("");
|
setPrompt("");
|
||||||
setCommand(str);
|
setCommand(str);
|
||||||
|
if (!forceSingle &&
|
||||||
|
commandWidget.inputField.editor
|
||||||
|
.selection.getRangeAt(0)
|
||||||
|
.startContainer.parentNode
|
||||||
|
.scrollWidth > commandWidget.inputField.scrollWidth)
|
||||||
|
// Yeah, the min-width is stupid. Somehow, it doesn't work otherwise.
|
||||||
|
setMultiline(<p style={"white-space: normal; min-width: " + commandWidget.inputField.scrollWidth + "px; width: 100%"}>{str}</p>, highlightGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: extract CSS
|
// TODO: extract CSS
|
||||||
@@ -257,14 +265,14 @@ function CommandLine() //{{{
|
|||||||
elements[elements.length - 1].scrollIntoView(true);
|
elements[elements.length - 1].scrollIntoView(true);
|
||||||
|
|
||||||
if (win.scrollY >= win.scrollMaxY)
|
if (win.scrollY >= win.scrollMaxY)
|
||||||
setLine("Press ENTER or type command to continue", commandline.HL_QUESTION);
|
setLine("Press ENTER or type command to continue", commandline.HL_QUESTION, true);
|
||||||
else
|
else
|
||||||
setLine("-- More --", commandline.HL_QUESTION);
|
setLine("-- More --", commandline.HL_QUESTION, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
win.scrollTo(0, contentHeight);
|
win.scrollTo(0, contentHeight);
|
||||||
setLine("Press ENTER or type command to continue", commandline.HL_QUESTION);
|
setLine("Press ENTER or type command to continue", commandline.HL_QUESTION, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
win.focus();
|
win.focus();
|
||||||
@@ -1185,7 +1193,7 @@ function CommandLine() //{{{
|
|||||||
{
|
{
|
||||||
const selType = Components.interfaces.nsISelectionController["SELECTION_" + type];
|
const selType = Components.interfaces.nsISelectionController["SELECTION_" + type];
|
||||||
let editor = document.getElementById("liberator-commandline-command")
|
let editor = document.getElementById("liberator-commandline-command")
|
||||||
.inputField.QueryInterface(Components.interfaces.nsIDOMNSEditableElement).editor;
|
.inputField.editor;
|
||||||
let sel = editor.selectionController.getSelection(selType);
|
let sel = editor.selectionController.getSelection(selType);
|
||||||
sel.removeAllRanges();
|
sel.removeAllRanges();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user