forked from qt-creator/qt-creator
TextEditor: Add selecting highlighter by name
Change-Id: I5c706dd151173bf08c5fbd4dacbf6e5d6416b87b Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
namespace TextEditor {
|
||||
class TextDocument;
|
||||
|
||||
class Highlighter : public SyntaxHighlighter, public KSyntaxHighlighting::AbstractHighlighter
|
||||
class TEXTEDITOR_EXPORT Highlighter : public SyntaxHighlighter,
|
||||
public KSyntaxHighlighting::AbstractHighlighter
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(KSyntaxHighlighting::AbstractHighlighter)
|
||||
|
@@ -9068,6 +9068,12 @@ void TextEditorWidget::configureGenericHighlighter(const Utils::MimeType &mimeTy
|
||||
d->removeSyntaxInfoBar();
|
||||
}
|
||||
|
||||
void TextEditorWidget::configureGenericHighlighter(const Highlighter::Definition &definition)
|
||||
{
|
||||
d->configureGenericHighlighter(definition);
|
||||
d->removeSyntaxInfoBar();
|
||||
}
|
||||
|
||||
int TextEditorWidget::blockNumberForVisibleRow(int row) const
|
||||
{
|
||||
QTextBlock block = blockForVisibleRow(row);
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#include "texteditor_global.h"
|
||||
|
||||
#include "codeassist/assistenums.h"
|
||||
#include "highlighter.h"
|
||||
#include "indenter.h"
|
||||
#include "refactoroverlay.h"
|
||||
#include "snippets/snippetparser.h"
|
||||
@@ -453,6 +454,9 @@ public:
|
||||
/// Overwrite the current highlighter with a new generic highlighter based on the given mimetype
|
||||
void configureGenericHighlighter(const Utils::MimeType &mimeType);
|
||||
|
||||
/// Overwrite the current highlighter with a new generic highlighter based on the given definition
|
||||
void configureGenericHighlighter(const Highlighter::Definition &definition);
|
||||
|
||||
Q_INVOKABLE void inSnippetMode(bool *active); // Used by FakeVim.
|
||||
|
||||
/*! Returns the document line number for the visible \a row.
|
||||
|
Reference in New Issue
Block a user