diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp index c44683eef36..2554a9db3cd 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.cpp +++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp @@ -31,6 +31,8 @@ #include "cppmodelmanager.h" #include "cpplocalsymbols.h" +#include + #include #include @@ -275,7 +277,9 @@ void CppEditorSupport::startHighlighting() if (!m_highlightingSupport) return; - if (!m_textEditor->widget()->isVisible()) + // Start highlighting only if the editor is or would be visible + // (in case another mode is active) in the edit mode. + if (!Core::EditorManager::instance()->visibleEditors().contains(m_textEditor)) return; if (m_highlightingSupport->requiresSemanticInfo()) {