aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/outputformatter.h
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-09-04 16:51:38 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-09-07 08:35:15 +0000
commitb0cad9e9c7aad209756fb2409520c0d048614dd9 (patch)
tree1cd9e91cfa0278ce35f3f3d272635d390d866e00 /src/libs/utils/outputformatter.h
parentf73f11d8c6418141581a77b97fc3c479a1bbaae5 (diff)
OutputFormatter: Fix visual glitchqds/v1.6.0-rc1qds/1.6.0-rc1
When inserting a line into an output window, we have to delay appending the line feed character. Otherwise strange visual effects appear under certain circumstances. I have no idea why. Fixes: QTCREATORBUG-24411 Change-Id: If8842ae4d9db36d514996b1f34dcca0432fafbfc Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/libs/utils/outputformatter.h')
-rw-r--r--src/libs/utils/outputformatter.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libs/utils/outputformatter.h b/src/libs/utils/outputformatter.h
index 6c8539d3ed..f9bcb145c3 100644
--- a/src/libs/utils/outputformatter.h
+++ b/src/libs/utils/outputformatter.h
@@ -83,8 +83,8 @@ public:
void setDemoteErrorsToWarnings(bool demote);
bool demoteErrorsToWarnings() const;
- // line contains at most one line feed character, and if it does occur, it's the last character.
- // Either way, the input is to be considered "complete" for parsing purposes.
+ // Represents a single line, without a trailing line feed character.
+ // The input is to be considered "complete" for parsing purposes.
virtual Result handleLine(const QString &line, OutputFormat format) = 0;
virtual bool handleLink(const QString &href) { Q_UNUSED(href); return false; }
@@ -183,6 +183,7 @@ private:
void append(const QString &text, const QTextCharFormat &format);
void initFormats();
void flushIncompleteLine();
+ void flushTrailingNewline();
void dumpIncompleteLine(const QString &line, OutputFormat format);
void clearLastLine();
QList<FormattedText> parseAnsi(const QString &text, const QTextCharFormat &format);