aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp')
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp
index 2bb61a7ae6..4987dc95f0 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp
@@ -156,15 +156,15 @@ void SyntaxHighlighter::highlightBlock(const QString& text)
void SyntaxHighlighter::applyFormat(int offset, int length, const KSyntaxHighlighting::Format& format)
{
- if (format.isDefaultTextStyle(theme()) || length == 0)
+ if (length == 0)
return;
QTextCharFormat tf;
- if (format.hasTextColor(theme()))
- tf.setForeground(format.textColor(theme()));
+ // always set the foreground color to avoid palette issues
+ tf.setForeground(format.textColor(theme()));
+
if (format.hasBackgroundColor(theme()))
tf.setBackground(format.backgroundColor(theme()));
-
if (format.isBold(theme()))
tf.setFontWeight(QFont::Bold);
if (format.isItalic(theme()))