TextEditor: Show info when multiple highlight definitions are available

Show an editor info bar when multiple highlight definitions can be found
for a single file or mime type. Add a combo box to the info that allows
the user to choose between them.

Change-Id: I07278d065e19d4e04fba24a6d789c8b6c9f55d60
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2019-02-07 08:50:16 +01:00
parent 0a974cb59f
commit 82466375b9
4 changed files with 39 additions and 17 deletions

View File

@@ -121,6 +121,11 @@ Highlighter::Definition Highlighter::definitionForFileName(const QString &fileNa
return highlightRepository()->definitionForFileName(fileName);
}
Highlighter::Definition Highlighter::definitionForName(const QString &name)
{
return highlightRepository()->definitionForName(name);
}
Highlighter::Definitions Highlighter::definitionsForDocument(const TextDocument *document)
{
const Utils::MimeType mimeType = Utils::mimeTypeForName(document->mimeType());