summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor/highlighterutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/texteditor/highlighterutils.cpp')
-rw-r--r--src/plugins/texteditor/highlighterutils.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/texteditor/highlighterutils.cpp b/src/plugins/texteditor/highlighterutils.cpp
index fec5ec798f..0e84c347e7 100644
--- a/src/plugins/texteditor/highlighterutils.cpp
+++ b/src/plugins/texteditor/highlighterutils.cpp
@@ -53,7 +53,8 @@ QString TextEditor::findDefinitionId(const Core::MimeType &mimeType,
return definitionId;
}
-void TextEditor::setMimeTypeForHighlighter(Highlighter *highlighter, const Core::MimeType &mimeType)
+void TextEditor::setMimeTypeForHighlighter(Highlighter *highlighter, const Core::MimeType &mimeType,
+ QString *foundDefinitionId)
{
const QString type = mimeType.type();
QString definitionId = Manager::instance()->definitionIdByMimeType(type);
@@ -66,6 +67,9 @@ void TextEditor::setMimeTypeForHighlighter(Highlighter *highlighter, const Core:
if (!definition.isNull() && definition->isValid())
highlighter->setDefaultContext(definition->initialContext());
}
+
+ if (foundDefinitionId)
+ *foundDefinitionId = definitionId;
}
SyntaxHighlighter *TextEditor::createGenericSyntaxHighlighter(const Core::MimeType &mimeType)