forked from qt-creator/qt-creator
SyntaxHighlighter: Add QTC_USE_THREADED_HIGHLIGHTER env variable
QTC_USE_THREADED_HIGHLIGHTER allows to opt-in or out threaded highlighter. It is on by default. Change-Id: I3e84f6f80101db5869a45c84cf1e8a8196c02be8 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
|
#include <utils/environment.h>
|
||||||
#include <utils/guard.h>
|
#include <utils/guard.h>
|
||||||
#include <utils/mimeutils.h>
|
#include <utils/mimeutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -908,7 +909,9 @@ void TextDocument::resetSyntaxHighlighter(const std::function<SyntaxHighlighter
|
|||||||
if (d->m_highlighterRunner)
|
if (d->m_highlighterRunner)
|
||||||
delete d->m_highlighterRunner;
|
delete d->m_highlighterRunner;
|
||||||
|
|
||||||
if (threaded) {
|
static const QString value
|
||||||
|
= qtcEnvironmentVariable("QTC_USE_THREADED_HIGHLIGHTER", "TRUE").toUpper();
|
||||||
|
if (threaded && value == QLatin1String("TRUE")) {
|
||||||
d->m_highlighterRunner = new ThreadedSyntaxHighlighterRunner(creator, document());
|
d->m_highlighterRunner = new ThreadedSyntaxHighlighterRunner(creator, document());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user