diff --git a/src/search/katesearchbar.cpp b/src/search/katesearchbar.cpp --- a/src/search/katesearchbar.cpp +++ b/src/search/katesearchbar.cpp @@ -1557,7 +1557,7 @@ void KateSearchBar::updateHighlightColors() { - const QColor foregroundColor = m_view->defaultStyleAttribute(KTextEditor::dsNormal)->foreground().color(); + const QColor foregroundColor = m_view->defaultStyleAttribute(KTextEditor::dsNormal)->selectedForeground().color(); const QColor &searchColor = m_view->renderer()->config()->searchHighlightColor(); const QColor &replaceColor = m_view->renderer()->config()->replaceHighlightColor(); diff --git a/src/view/kateview.cpp b/src/view/kateview.cpp --- a/src/view/kateview.cpp +++ b/src/view/kateview.cpp @@ -3572,7 +3572,7 @@ attr->setBackground(Qt::yellow); // set correct highlight color from Kate's color schema - QColor fgColor = defaultStyleAttribute(KTextEditor::dsNormal)->foreground().color(); + QColor fgColor = defaultStyleAttribute(KTextEditor::dsNormal)->selectedForeground().color(); QColor bgColor = renderer()->config()->searchHighlightColor(); attr->setForeground(fgColor); attr->setBackground(bgColor); diff --git a/src/vimode/emulatedcommandbar/matchhighlighter.cpp b/src/vimode/emulatedcommandbar/matchhighlighter.cpp --- a/src/vimode/emulatedcommandbar/matchhighlighter.cpp +++ b/src/vimode/emulatedcommandbar/matchhighlighter.cpp @@ -53,12 +53,15 @@ void MatchHighlighter::updateMatchHighlightAttrib() { - const QColor &matchColour = m_view->renderer()->config()->searchHighlightColor(); + const QColor &matchBg = m_view->renderer()->config()->searchHighlightColor(); + const QColor &matchFg = m_view->defaultStyleAttribute(KTextEditor::dsNormal)->selectedForeground().color(); if (!m_highlightMatchAttribute) { m_highlightMatchAttribute = new KTextEditor::Attribute; } - m_highlightMatchAttribute->setBackground(matchColour); + m_highlightMatchAttribute->setBackground(matchBg); + m_highlightMatchAttribute->setForeground(matchFg); KTextEditor::Attribute::Ptr mouseInAttribute(new KTextEditor::Attribute()); m_highlightMatchAttribute->setDynamicAttribute(KTextEditor::Attribute::ActivateMouseIn, mouseInAttribute); - m_highlightMatchAttribute->dynamicAttribute(KTextEditor::Attribute::ActivateMouseIn)->setBackground(matchColour); + m_highlightMatchAttribute->dynamicAttribute(KTextEditor::Attribute::ActivateMouseIn)->setBackground(matchBg); + m_highlightMatchAttribute->dynamicAttribute(KTextEditor::Attribute::ActivateMouseIn)->setForeground(matchFg); }