From 5b30509a992645ec9c067bc4d5a6f62c5af8c86c Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 7 May 2013 11:12:52 +0200 Subject: CppEditor: Fix highlighting if there are unconfigured projects If Creator switched to the Project mode on startup, the highlighting was not started because the editor widget was not visible. Now we check if the editor itself is or would be visible in the edit mode, which is indepedent of the current mode. Task-number: QTCREATORBUG-9260 Change-Id: I72373e09965fd1cded034ae4711df48798e7f0d8 Reviewed-by: Erik Verbruggen --- src/plugins/cpptools/cpptoolseditorsupport.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/cpptools/cpptoolseditorsupport.cpp') diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp index c44683eef3..2554a9db3c 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()) { -- cgit v1.2.1