mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 05:38:01 +01:00
Fix rendering of multiple FORCE_MULTILINE :echo commands.
This commit is contained in:
@@ -910,7 +910,6 @@ function CommandLine() //{{{
|
|||||||
{
|
{
|
||||||
// TODO: are all messages single line? Some display an aggregation
|
// TODO: are all messages single line? Some display an aggregation
|
||||||
// of single line messages at least. E.g. :source
|
// of single line messages at least. E.g. :source
|
||||||
// FIXME: I retract my retraction, this command-line/MOW mismatch _is_ really annoying -- djk
|
|
||||||
if (messageHistory.length == 1)
|
if (messageHistory.length == 1)
|
||||||
{
|
{
|
||||||
let message = messageHistory.messages[0];
|
let message = messageHistory.messages[0];
|
||||||
@@ -1115,7 +1114,8 @@ function CommandLine() //{{{
|
|||||||
*
|
*
|
||||||
* @param {string} str
|
* @param {string} str
|
||||||
* @param {string} highlightGroup The Highlight group for the
|
* @param {string} highlightGroup The Highlight group for the
|
||||||
* message. @default "Normal"
|
* message.
|
||||||
|
* @default "Normal"
|
||||||
* @param {number} flags Changes the behavior as follows:
|
* @param {number} flags Changes the behavior as follows:
|
||||||
* commandline.APPEND_TO_MESSAGES - Causes message to be added to the
|
* commandline.APPEND_TO_MESSAGES - Causes message to be added to the
|
||||||
* messages history, and shown by :messages.
|
* messages history, and shown by :messages.
|
||||||
@@ -1131,7 +1131,7 @@ function CommandLine() //{{{
|
|||||||
{
|
{
|
||||||
// liberator.echo uses different order of flags as it omits the highlight group, change commandline.echo argument order? --mst
|
// liberator.echo uses different order of flags as it omits the highlight group, change commandline.echo argument order? --mst
|
||||||
if (silent)
|
if (silent)
|
||||||
return false;
|
return;
|
||||||
|
|
||||||
highlightGroup = highlightGroup || this.HL_NORMAL;
|
highlightGroup = highlightGroup || this.HL_NORMAL;
|
||||||
|
|
||||||
@@ -1141,11 +1141,15 @@ function CommandLine() //{{{
|
|||||||
// The DOM isn't threadsafe. It must only be accessed from the main thread.
|
// The DOM isn't threadsafe. It must only be accessed from the main thread.
|
||||||
liberator.callInMainThread(function ()
|
liberator.callInMainThread(function ()
|
||||||
{
|
{
|
||||||
let single = flags & (this.FORCE_SINGLELINE | this.DISALLOW_MULTILINE);
|
if ((flags & this.DISALLOW_MULTILINE) && !outputContainer.collapsed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
let single = flags & (this.FORCE_SINGLELINE | this.DISALLOW_MULTILINE);
|
||||||
let action = echoLine;
|
let action = echoLine;
|
||||||
|
|
||||||
if (!single && (!outputContainer.collapsed || messageBox.value == lastEcho))
|
// TODO: this is all a bit convoluted - clean up.
|
||||||
|
// assume that FORCE_MULTILINE output is fully styled
|
||||||
|
if (!(flags & this.FORCE_MULTILINE) && !single && (!outputContainer.collapsed || messageBox.value == lastEcho))
|
||||||
{
|
{
|
||||||
highlightGroup += " Message";
|
highlightGroup += " Message";
|
||||||
action = echoMultiline;
|
action = echoMultiline;
|
||||||
@@ -1154,9 +1158,6 @@ function CommandLine() //{{{
|
|||||||
if ((flags & this.FORCE_MULTILINE) || (/\n/.test(str) || typeof str == "xml") && !(flags & this.FORCE_SINGLELINE))
|
if ((flags & this.FORCE_MULTILINE) || (/\n/.test(str) || typeof str == "xml") && !(flags & this.FORCE_SINGLELINE))
|
||||||
action = echoMultiline;
|
action = echoMultiline;
|
||||||
|
|
||||||
if ((flags & this.DISALLOW_MULTILINE) && !outputContainer.collapsed)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (single)
|
if (single)
|
||||||
lastEcho = null;
|
lastEcho = null;
|
||||||
else
|
else
|
||||||
@@ -1170,8 +1171,6 @@ function CommandLine() //{{{
|
|||||||
if (action)
|
if (action)
|
||||||
action(str, highlightGroup, single);
|
action(str, highlightGroup, single);
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ ARCHITECTURE:
|
|||||||
breaks Asciidoc formatting in certain unpredictable (to me at least)
|
breaks Asciidoc formatting in certain unpredictable (to me at least)
|
||||||
contexts. *sigh* --djk
|
contexts. *sigh* --djk
|
||||||
- move as much as possible to common/*
|
- move as much as possible to common/*
|
||||||
- decide on how to document Arrays in our jsdoc(ish) documentation.
|
- decide on how to document Arrays in our jsdoc(ish) documentation. Is there
|
||||||
|
even a documentation tool that can parse our source sensibly?
|
||||||
|
|
||||||
BUGS:
|
BUGS:
|
||||||
- add window resize support to hints
|
- add window resize support to hints
|
||||||
@@ -25,12 +26,10 @@ BUGS:
|
|||||||
else it chucks, I haven't investigated --djk
|
else it chucks, I haven't investigated --djk
|
||||||
- messages is still broken in several ways - needs testing.
|
- messages is still broken in several ways - needs testing.
|
||||||
=> :ls | :echomsg "Foobar" doesn't add "Foobar" to the already open MOW.
|
=> :ls | :echomsg "Foobar" doesn't add "Foobar" to the already open MOW.
|
||||||
|
(NOTE: an intentional design decision by MS - Boo!)
|
||||||
=> it often overwrites the open command line while editing etc.
|
=> it often overwrites the open command line while editing etc.
|
||||||
- <tags> and <keyword> autocmd 'keywords' are not available when adding a
|
- <tags> and <keyword> autocmd 'keywords' are not available when adding a
|
||||||
bookmark - they're being set after the observer triggers the autocmd event.
|
bookmark - they're being set after the observer triggers the autocmd event.
|
||||||
- MOW rendering is broken for multiple commands when open (E.g. :ls | ls) This
|
|
||||||
appears to be the result of using the Message class when appending multiline
|
|
||||||
output to an open MOW.
|
|
||||||
- :messages is _very_ slow for message history of several thousand lines ->
|
- :messages is _very_ slow for message history of several thousand lines ->
|
||||||
Unresponsive Script: util.js:79 (sometimes xmlToDom() and elsewhere)
|
Unresponsive Script: util.js:79 (sometimes xmlToDom() and elsewhere)
|
||||||
- The MOW shouldn't close when executing hints and ;F isn't working.
|
- The MOW shouldn't close when executing hints and ;F isn't working.
|
||||||
|
|||||||
Reference in New Issue
Block a user