From 6872fe7944472bd5837174f4d8d2e0b4a1f056fc Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 6 Oct 2008 01:52:02 +0000 Subject: [PATCH] if there's only one message in the message history output it to the command-line widget rather than the MOW --- content/ui.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/content/ui.js b/content/ui.js index c96c5042..3761780b 100644 --- a/content/ui.js +++ b/content/ui.js @@ -502,12 +502,21 @@ liberator.CommandLine = function () //{{{ { // TODO: are all messages single line? Some display an aggregation // of single line messages at least. E.g. :source - let list = <>; + // FIXME: I retract my retraction, this command-line/MOW mismatch _is_ really annoying -- djk + if (messageHistory.length == 1) + { + let message = messageHistory.messages[0]; + liberator.commandline.echo(message.str, message.highlight, liberator.commandline.FORCE_SINGLELINE); + } + else if (messageHistory.length > 1) + { + let list = <>; - for (let [,message] in Iterator(messageHistory.messages)) - list +=
{message.msg}
; + for (let [,message] in Iterator(messageHistory.messages)) + list +=
{message.str}
; - liberator.commandline.echo(list, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE); + liberator.echo(list, liberator.commandline.FORCE_MULTILINE); + } }, { argCount: "0" }); @@ -606,7 +615,7 @@ liberator.CommandLine = function () //{{{ highlightGroup = highlightGroup || this.HL_NORMAL; if (flags & this.APPEND_TO_MESSAGES) - messageHistory.add({ msg: str, highlight: highlightGroup }); + messageHistory.add({ str: str, highlight: highlightGroup }); var where = setLine; if (flags & this.FORCE_MULTILINE)