From d99e00c49f8b15f05225d4fa160e8ed94026a83f Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 18 Sep 2020 13:37:37 +0200 Subject: [PATCH] TextEditor: allow highlightings in selections If the selection foregound color is undefined do not overwrite the already applied highlighting. Fixes: QTCREATORBUG-24656 Change-Id: Ia125e8e6b9efba73d5a13facc2446a793d59f5c3 Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 07f85704834..8a2036f5244 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -4724,8 +4724,7 @@ void TextEditorWidgetPrivate::setupSelections(const PaintEventData &data, const QTextCharFormat selectionFormat = data.fontSettings.toTextCharFormat(C_SELECTION); if (selectionFormat.background().style() != Qt::NoBrush) o.format.setBackground(selectionFormat.background()); - if (selectionFormat.foreground().style() != Qt::NoBrush) - o.format.setForeground(selectionFormat.foreground()); + o.format.setForeground(selectionFormat.foreground()); } if ((data.textCursor.hasSelection() && i == data.context.selections.size() - 1) || (o.format.foreground().style() == Qt::NoBrush