From b0cad9e9c7aad209756fb2409520c0d048614dd9 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 4 Sep 2020 16:51:38 +0200 Subject: OutputFormatter: Fix visual glitch 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 --- src/libs/utils/outputformatter.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libs/utils/outputformatter.h') 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 parseAnsi(const QString &text, const QTextCharFormat &format); -- cgit v1.2.3