diff options
author | Kris Maglione <maglione.k@gmail.com> | 2008-12-07 11:33:56 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2008-12-07 11:33:56 -0500 |
commit | 0876a3bef2b0c742d04668f5b5eb4879984417f7 (patch) | |
tree | 9f335d2192c142b084098c80dc862f3bc49bedbc /common/content/ui.js | |
parent | 7693ac50001e3c1c4326546f9957080338baefe1 (diff) | |
download | pentadactyl-0876a3bef2b0c742d04668f5b5eb4879984417f7.tar.gz |
Push lines to the MOW where appropriate
Diffstat (limited to 'common/content/ui.js')
-rw-r--r-- | common/content/ui.js | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/common/content/ui.js b/common/content/ui.js index c0b84460..72cf4e3a 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -71,6 +71,7 @@ function CommandLine() //{{{ var silent = false; var keepCommand = false; + var lastEcho = null; function History(inputField, mode) { @@ -951,12 +952,17 @@ function CommandLine() //{{{ // The DOM isn't threadsafe. It must only be accessed from the main thread. liberator.callInMainThread(function () { - let action = outputContainer.collapsed ? echoLine : echoMultiline; - if (flags & commandline.FORCE_MULTILINE) + let action = echoLine; + if (!outputContainer.collapsed || messageBox.value == lastEcho) action = echoMultiline; - else if (flags & commandline.FORCE_SINGLELINE) + + let single = flags & (this.FORCE_SINGLELINE | this.DISALLOW_MULTILINE); + + if (flags & this.FORCE_MULTILINE) + action = echoMultiline; + else if (flags & this.FORCE_SINGLELINE) action = echoLine; - else if (flags & commandline.DISALLOW_MULTILINE) + else if (flags & this.DISALLOW_MULTILINE) { if (!outputContainer.collapsed) action = null; @@ -966,9 +972,18 @@ function CommandLine() //{{{ else if (/\n/.test(str) || typeof str == "xml") action = echoMultiline; + if (single) + lastEcho = null; + else + { + if (messageBox.value == lastEcho) + echoMultiline(lastEcho); + lastEcho = (action == echoLine) && str; + } + if (action) - action(str, highlightGroup, (flags & (this.FORCE_SINGLELINE | this.DISALLOW_MULTILINE))); - }); + action(str, highlightGroup, single); + }, this); return true; }, |