Commit e8801167 authored by jkobus's avatar jkobus Committed by Jarek Kobus

Add common interface for text formats inside syntax highlighter

Change-Id: I87f64446161a57aea0896f68e4eafacef791969b
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 760aa0f8
......@@ -33,9 +33,8 @@ using namespace Bazaar::Internal;
using namespace Bazaar;
BazaarAnnotationHighlighter::BazaarAnnotationHighlighter(const ChangeNumbers &changeNumbers,
const QColor &bg,
QTextDocument *document)
: VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document),
: VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
m_changeset(QLatin1String(Constants::ANNOTATE_CHANGESET_ID))
{
}
......
......@@ -38,7 +38,7 @@ namespace Internal {
class BazaarAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter
{
public:
explicit BazaarAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg,
explicit BazaarAnnotationHighlighter(const ChangeNumbers &changeNumbers,
QTextDocument *document = 0);
private:
......
......@@ -35,7 +35,6 @@
#include <QRegExp>
#include <QString>
#include <QTextCursor>
#include <QDebug>
#define BZR_CHANGE_PATTERN "[0-9]+"
......@@ -107,8 +106,7 @@ QString BazaarEditor::changeUnderCursor(const QTextCursor &cursorIn) const
return QString();
}
VcsBase::BaseAnnotationHighlighter *BazaarEditor::createAnnotationHighlighter(const QSet<QString> &changes,
const QColor &bg) const
VcsBase::BaseAnnotationHighlighter *BazaarEditor::createAnnotationHighlighter(const QSet<QString> &changes) const
{
return new BazaarAnnotationHighlighter(changes, bg);
return new BazaarAnnotationHighlighter(changes);
}
......@@ -46,7 +46,7 @@ public:
private:
QSet<QString> annotationChanges() const;
QString changeUnderCursor(const QTextCursor &cursor) const;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
mutable QRegExp m_changesetId;
mutable QRegExp m_exactChangesetId;
......
......@@ -34,9 +34,8 @@ using namespace ClearCase;
using namespace ClearCase::Internal;
ClearCaseAnnotationHighlighter::ClearCaseAnnotationHighlighter(const ChangeNumbers &changeNumbers,
const QColor &bg,
QTextDocument *document) :
VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document),
VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
m_separator(QLatin1Char('|'))
{
}
......
......@@ -41,7 +41,7 @@ class ClearCaseAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter
{
Q_OBJECT
public:
explicit ClearCaseAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg,
explicit ClearCaseAnnotationHighlighter(const ChangeNumbers &changeNumbers,
QTextDocument *document = 0);
private:
......
......@@ -36,7 +36,6 @@
#include <utils/qtcassert.h>
#include <vcsbase/diffhighlighter.h>
#include <QDebug>
#include <QDir>
#include <QFileInfo>
#include <QTextBlock>
......@@ -94,8 +93,7 @@ QString ClearCaseEditor::changeUnderCursor(const QTextCursor &c) const
return QString();
}
VcsBase::BaseAnnotationHighlighter *ClearCaseEditor::createAnnotationHighlighter(const QSet<QString> &changes,
const QColor &bg) const
VcsBase::BaseAnnotationHighlighter *ClearCaseEditor::createAnnotationHighlighter(const QSet<QString> &changes) const
{
return new ClearCaseAnnotationHighlighter(changes, bg);
return new ClearCaseAnnotationHighlighter(changes);
}
......@@ -49,7 +49,7 @@ public:
private:
QSet<QString> annotationChanges() const;
QString changeUnderCursor(const QTextCursor &) const;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
QRegExp m_versionNumberPattern;
};
......
......@@ -40,13 +40,13 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/texteditorsettings.h>
#include <QFileInfo>
#include <QSharedPointer>
#include <QTextBlock>
using namespace CMakeProjectManager;
using namespace CMakeProjectManager::Internal;
......@@ -141,27 +141,6 @@ void CMakeEditorWidget::contextMenuEvent(QContextMenuEvent *e)
showDefaultContextMenu(e, Constants::M_CONTEXT);
}
void CMakeEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
{
TextEditor::BaseTextEditorWidget::setFontSettings(fs);
CMakeHighlighter *highlighter = qobject_cast<CMakeHighlighter*>(baseTextDocument()->syntaxHighlighter());
if (!highlighter)
return;
static QVector<TextEditor::TextStyle> categories;
if (categories.isEmpty()) {
categories << TextEditor::C_LABEL // variables
<< TextEditor::C_KEYWORD // functions
<< TextEditor::C_COMMENT
<< TextEditor::C_STRING
<< TextEditor::C_VISUAL_WHITESPACE;
}
const QVector<QTextCharFormat> formats = fs.toTextCharFormats(categories);
highlighter->setFormats(formats.constBegin(), formats.constEnd());
highlighter->rehighlight();
}
static bool isValidFileNameChar(const QChar &c)
{
if (c.isLetterOrNumber()
......
......@@ -85,7 +85,6 @@ protected:
public slots:
void unCommentSelection();
void setFontSettings(const TextEditor::FontSettings &);
private:
CMakeEditorFactory *m_factory;
......
......@@ -30,9 +30,7 @@
#include "cmakehighlighter.h"
#include <QRegExp>
#include <QColor>
#include <QTextDocument>
#include <QTextEdit>
using namespace CMakeProjectManager::Internal;
......@@ -48,6 +46,15 @@ static bool isVariable(const QByteArray &word)
CMakeHighlighter::CMakeHighlighter(QTextDocument *document) :
TextEditor::SyntaxHighlighter(document)
{
static QVector<TextEditor::TextStyle> categories;
if (categories.isEmpty()) {
categories << TextEditor::C_LABEL // variables
<< TextEditor::C_KEYWORD // functions
<< TextEditor::C_COMMENT
<< TextEditor::C_STRING
<< TextEditor::C_VISUAL_WHITESPACE;
}
setTextFormatCategories(categories);
}
......@@ -62,12 +69,12 @@ void CMakeHighlighter::highlightBlock(const QString &text)
for (i=0; i < text.length(); i++) {
char c = text.at(i).toLatin1();
if (inCommentMode) {
setFormat(i, 1, m_formats[CMakeCommentFormat]);
setFormat(i, 1, formatForCategory(CMakeCommentFormat));
} else {
if (c == '#') {
if (!inStringMode) {
inCommentMode = true;
setFormat(i, 1, m_formats[CMakeCommentFormat]);
setFormat(i, 1, formatForCategory(CMakeCommentFormat));
buf.clear();
} else {
buf += c;
......@@ -75,7 +82,7 @@ void CMakeHighlighter::highlightBlock(const QString &text)
} else if (c == '(') {
if (!inStringMode) {
if (!buf.isEmpty())
setFormat(i - buf.length(), buf.length(), m_formats[CMakeFunctionFormat]);
setFormat(i - buf.length(), buf.length(), formatForCategory(CMakeFunctionFormat));
buf.clear();
} else {
buf += c;
......@@ -88,10 +95,10 @@ void CMakeHighlighter::highlightBlock(const QString &text)
} else if (c == '\"') {
buf += c;
if (inStringMode) {
setFormat(i + 1 - buf.length(), buf.length(), m_formats[CMakeStringFormat]);
setFormat(i + 1 - buf.length(), buf.length(), formatForCategory(CMakeStringFormat));
buf.clear();
} else {
setFormat(i, 1, m_formats[CMakeStringFormat]);
setFormat(i, 1, formatForCategory(CMakeStringFormat));
}
inStringMode = !inStringMode;
} else if (c == '\\') {
......@@ -105,14 +112,14 @@ void CMakeHighlighter::highlightBlock(const QString &text)
}
} else if (c == '$') {
if (inStringMode)
setFormat(i - buf.length(), buf.length(), m_formats[CMakeStringFormat]);
setFormat(i - buf.length(), buf.length(), formatForCategory(CMakeStringFormat));
buf.clear();
buf += c;
setFormat(i, 1, emptyFormat);
} else if (c == '}') {
buf += c;
if (isVariable(buf)) {
setFormat(i + 1 - buf.length(), buf.length(), m_formats[CMakeVariableFormat]);
setFormat(i + 1 - buf.length(), buf.length(), formatForCategory(CMakeVariableFormat));
buf.clear();
}
} else {
......@@ -123,12 +130,12 @@ void CMakeHighlighter::highlightBlock(const QString &text)
}
if (inStringMode) {
setFormat(i - buf.length(), buf.length(), m_formats[CMakeStringFormat]);
setFormat(i - buf.length(), buf.length(), formatForCategory(CMakeStringFormat));
setCurrentBlockState(1);
} else {
setCurrentBlockState(0);
}
applyFormatToSpaces(text, m_formats[CMakeVisualWhiteSpaceFormat]);
applyFormatToSpaces(text, formatForCategory(CMakeVisualWhiteSpaceFormat));
}
......@@ -31,9 +31,6 @@
#define CMAKEHIGHLIGHTER_H
#include <texteditor/syntaxhighlighter.h>
#include <QtAlgorithms>
#include <QSyntaxHighlighter>
#include <QTextCharFormat>
namespace CMakeProjectManager {
namespace Internal {
......@@ -50,21 +47,11 @@ public:
CMakeFunctionFormat,
CMakeCommentFormat,
CMakeStringFormat,
CMakeVisualWhiteSpaceFormat,
NumCMakeFormats
CMakeVisualWhiteSpaceFormat
};
CMakeHighlighter(QTextDocument *document = 0);
virtual void highlightBlock(const QString &text);
// Set formats from a sequence of type QTextCharFormat
template <class InputIterator>
void setFormats(InputIterator begin, InputIterator end) {
qCopy(begin, end, m_formats);
}
private:
QTextCharFormat m_formats[NumCMakeFormats];
};
} // namespace Internal
......
......@@ -1887,14 +1887,10 @@ const Utils::CommentDefinition *CPPEditor::commentDefinition() const
void CPPEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
{
TextEditor::BaseTextEditorWidget::setFontSettings(fs);
CppHighlighter *highlighter
= qobject_cast<CppHighlighter*>(baseTextDocument()->syntaxHighlighter());
TextEditor::SyntaxHighlighter *highlighter = baseTextDocument()->syntaxHighlighter();
if (!highlighter)
return;
const QVector<QTextCharFormat> formats = fs.toTextCharFormats(highlighterFormatCategories());
highlighter->setFormats(formats.constBegin(), formats.constEnd());
m_occurrencesFormat = fs.toTextCharFormat(TextEditor::C_OCCURRENCES);
m_occurrencesUnusedFormat = fs.toTextCharFormat(TextEditor::C_OCCURRENCES_UNUSED);
m_occurrencesUnusedFormat.setUnderlineStyle(QTextCharFormat::WaveUnderline);
......
......@@ -28,6 +28,7 @@
****************************************************************************/
#include "cpphighlighter.h"
#include "cppeditorenums.h"
#include <cpptools/cppdoxygen.h>
#include <cpptools/cpptoolsreuse.h>
......@@ -37,7 +38,6 @@
#include <cplusplus/Lexer.h>
#include <QTextDocument>
#include <QDebug>
using namespace CppEditor::Internal;
using namespace TextEditor;
......@@ -46,6 +46,21 @@ using namespace CPlusPlus;
CppHighlighter::CppHighlighter(QTextDocument *document) :
TextEditor::SyntaxHighlighter(document)
{
static QVector<TextEditor::TextStyle> categories;
if (categories.isEmpty()) {
categories << TextEditor::C_NUMBER
<< TextEditor::C_STRING
<< TextEditor::C_TYPE
<< TextEditor::C_KEYWORD
<< TextEditor::C_OPERATOR
<< TextEditor::C_PREPROCESSOR
<< TextEditor::C_LABEL
<< TextEditor::C_COMMENT
<< TextEditor::C_DOXYGEN_COMMENT
<< TextEditor::C_DOXYGEN_TAG
<< TextEditor::C_VISUAL_WHITESPACE;
}
setTextFormatCategories(categories);
}
void CppHighlighter::highlightBlock(const QString &text)
......@@ -80,11 +95,11 @@ void CppHighlighter::highlightBlock(const QString &text)
BaseTextDocumentLayout::clearParentheses(currentBlock());
if (text.length()) {// the empty line can still contain whitespace
if (initialState == Lexer::State_MultiLineComment)
highlightLine(text, 0, text.length(), m_formats[CppCommentFormat]);
highlightLine(text, 0, text.length(), formatForCategory(CppCommentFormat));
else if (initialState == Lexer::State_MultiLineDoxyComment)
highlightLine(text, 0, text.length(), m_formats[CppDoxygenCommentFormat]);
highlightLine(text, 0, text.length(), formatForCategory(CppDoxygenCommentFormat));
else
setFormat(0, text.length(), m_formats[CppVisualWhitespace]);
setFormat(0, text.length(), formatForCategory(CppVisualWhitespace));
}
BaseTextDocumentLayout::setFoldingIndent(currentBlock(), foldingIndent);
return;
......@@ -109,7 +124,7 @@ void CppHighlighter::highlightBlock(const QString &text)
}
if (previousTokenEnd != tk.begin())
setFormat(previousTokenEnd, tk.begin() - previousTokenEnd, m_formats[CppVisualWhitespace]);
setFormat(previousTokenEnd, tk.begin() - previousTokenEnd, formatForCategory(CppVisualWhitespace));
if (tk.is(T_LPAREN) || tk.is(T_LBRACE) || tk.is(T_LBRACKET)) {
const QChar c = text.at(tk.begin());
......@@ -148,11 +163,11 @@ void CppHighlighter::highlightBlock(const QString &text)
continue;
if (i == 0 && tk.is(T_POUND)) {
highlightLine(text, tk.begin(), tk.length(), m_formats[CppPreprocessorFormat]);
highlightLine(text, tk.begin(), tk.length(), formatForCategory(CppPreprocessorFormat));
expectPreprocessorKeyword = true;
} else if (highlightCurrentWordAsPreprocessor &&
(tk.isKeyword() || tk.is(T_IDENTIFIER)) && isPPKeyword(text.midRef(tk.begin(), tk.length()))) {
setFormat(tk.begin(), tk.length(), m_formats[CppPreprocessorFormat]);
setFormat(tk.begin(), tk.length(), formatForCategory(CppPreprocessorFormat));
const QStringRef ppKeyword = text.midRef(tk.begin(), tk.length());
if (ppKeyword == QLatin1String("error")
|| ppKeyword == QLatin1String("warning")
......@@ -161,13 +176,13 @@ void CppHighlighter::highlightBlock(const QString &text)
}
} else if (tk.is(T_NUMERIC_LITERAL)) {
setFormat(tk.begin(), tk.length(), m_formats[CppNumberFormat]);
setFormat(tk.begin(), tk.length(), formatForCategory(CppNumberFormat));
} else if (tk.isStringLiteral() || tk.isCharLiteral()) {
highlightLine(text, tk.begin(), tk.length(), m_formats[CppStringFormat]);
highlightLine(text, tk.begin(), tk.length(), formatForCategory(CppStringFormat));
} else if (tk.isComment()) {
const int startPosition = initialState ? previousTokenEnd : tk.begin();
if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT))
highlightLine(text, startPosition, tk.end() - startPosition, m_formats[CppCommentFormat]);
highlightLine(text, startPosition, tk.end() - startPosition, formatForCategory(CppCommentFormat));
else // a doxygen comment
highlightDoxygenComment(text, startPosition, tk.end() - startPosition);
......@@ -191,11 +206,11 @@ void CppHighlighter::highlightBlock(const QString &text)
}
} else if (tk.isKeyword() || CppTools::isQtKeyword(text.midRef(tk.begin(), tk.length())) || tk.isObjCAtKeyword()) {
setFormat(tk.begin(), tk.length(), m_formats[CppKeywordFormat]);
setFormat(tk.begin(), tk.length(), formatForCategory(CppKeywordFormat));
} else if (tk.isOperator()) {
setFormat(tk.begin(), tk.length(), m_formats[CppOperatorFormat]);
setFormat(tk.begin(), tk.length(), formatForCategory(CppOperatorFormat));
} else if (i == 0 && tokens.size() > 1 && tk.is(T_IDENTIFIER) && tokens.at(1).is(T_COLON)) {
setFormat(tk.begin(), tk.length(), m_formats[CppLabelFormat]);
setFormat(tk.begin(), tk.length(), formatForCategory(CppLabelFormat));
} else if (tk.is(T_IDENTIFIER)) {
highlightWord(text.midRef(tk.begin(), tk.length()), tk.begin(), tk.length());
}
......@@ -204,7 +219,7 @@ void CppHighlighter::highlightBlock(const QString &text)
// mark the trailing white spaces
const int lastTokenEnd = tokens.last().end();
if (text.length() > lastTokenEnd)
highlightLine(text, lastTokenEnd, text.length() - lastTokenEnd, m_formats[CppVisualWhitespace]);
highlightLine(text, lastTokenEnd, text.length() - lastTokenEnd, formatForCategory(CppVisualWhitespace));
if (!initialState && state && !tokens.isEmpty()) {
parentheses.append(Parenthesis(Parenthesis::Opened, QLatin1Char('+'),
......@@ -326,7 +341,7 @@ bool CppHighlighter::isPPKeyword(const QStringRef &text) const
void CppHighlighter::highlightLine(const QString &text, int position, int length,
const QTextCharFormat &format)
{
QTextCharFormat visualSpaceFormat = m_formats[CppVisualWhitespace];
QTextCharFormat visualSpaceFormat = formatForCategory(CppVisualWhitespace);
visualSpaceFormat.setBackground(format.background());
const int end = position + length;
......@@ -360,7 +375,7 @@ void CppHighlighter::highlightWord(QStringRef word, int position, int length)
return;
}
setFormat(position, length, m_formats[CppTypeFormat]);
setFormat(position, length, formatForCategory(CppTypeFormat));
}
}
}
......@@ -372,8 +387,8 @@ void CppHighlighter::highlightDoxygenComment(const QString &text, int position,
const QChar *uc = text.unicode();
const QChar *it = uc + position;
const QTextCharFormat &format = m_formats[CppDoxygenCommentFormat];
const QTextCharFormat &kwFormat = m_formats[CppDoxygenTagFormat];
const QTextCharFormat &format = formatForCategory(CppDoxygenCommentFormat);
const QTextCharFormat &kwFormat = formatForCategory(CppDoxygenTagFormat);
while (!it->isNull()) {
if (it->unicode() == QLatin1Char('\\') ||
......
......@@ -30,8 +30,6 @@
#ifndef CPPHIGHLIGHTER_H
#define CPPHIGHLIGHTER_H
#include "cppeditorenums.h"
#include <texteditor/syntaxhighlighter.h>
#include <QTextCharFormat>
......@@ -51,12 +49,6 @@ public:
virtual void highlightBlock(const QString &text);
// Set formats from a sequence of type QTextCharFormat
template <class InputIterator>
void setFormats(InputIterator begin, InputIterator end) {
qCopy(begin, end, m_formats);
}
private:
void highlightWord(QStringRef word, int position, int length);
void highlightLine(const QString &line, int position, int length,
......@@ -66,8 +58,6 @@ private:
int length);
bool isPPKeyword(const QStringRef &text) const;
QTextCharFormat m_formats[NumCppFormats];
};
} // namespace Internal
......
......@@ -36,8 +36,6 @@
#include <cpptools/cppqtstyleindenter.h>
#include <texteditor/texteditorsettings.h>
#include <texteditor/fontsettings.h>
#include <texteditor/snippets/snippeteditor.h>
#include <QLatin1String>
......@@ -65,12 +63,7 @@ QString CppSnippetProvider::displayName() const
void CppSnippetProvider::decorateEditor(TextEditor::SnippetEditorWidget *editor) const
{
CppHighlighter *highlighter = new CppHighlighter;
const TextEditor::FontSettings &fs = TextEditor::TextEditorSettings::instance()->fontSettings();
const QVector<QTextCharFormat> &formats =
fs.toTextCharFormats(CPPEditorWidget::highlighterFormatCategories());
highlighter->setFormats(formats.constBegin(), formats.constEnd());
editor->setSyntaxHighlighter(highlighter);
editor->setSyntaxHighlighter(new CppHighlighter);
editor->setIndenter(new CppTools::CppQtStyleIndenter);
editor->setAutoCompleter(new CppAutoCompleter);
}
......@@ -33,9 +33,8 @@ using namespace Cvs;
using namespace Cvs::Internal;
CvsAnnotationHighlighter::CvsAnnotationHighlighter(const ChangeNumbers &changeNumbers,
const QColor &bg,
QTextDocument *document) :
VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document),
VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
m_blank(QLatin1Char(' '))
{
}
......
......@@ -41,7 +41,7 @@ class CvsAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter
Q_OBJECT
public:
explicit CvsAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg,
explicit CvsAnnotationHighlighter(const ChangeNumbers &changeNumbers,
QTextDocument *document = 0);
private:
......
......@@ -123,10 +123,9 @@ QString CvsEditor::changeUnderCursor(const QTextCursor &c) const
return QString();
}
VcsBase::BaseAnnotationHighlighter *CvsEditor::createAnnotationHighlighter(const QSet<QString> &changes,
const QColor &bg) const
VcsBase::BaseAnnotationHighlighter *CvsEditor::createAnnotationHighlighter(const QSet<QString> &changes) const
{
return new CvsAnnotationHighlighter(changes, bg);
return new CvsAnnotationHighlighter(changes);
}
QStringList CvsEditor::annotationPreviousVersions(const QString &revision) const
......
......@@ -48,7 +48,7 @@ public:
private:
QSet<QString> annotationChanges() const;
QString changeUnderCursor(const QTextCursor &) const;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
QStringList annotationPreviousVersions(const QString &revision) const;
mutable QRegExp m_revisionAnnotationPattern;
......
......@@ -35,9 +35,8 @@ namespace Git {
namespace Internal {
GitAnnotationHighlighter::GitAnnotationHighlighter(const ChangeNumbers &changeNumbers,
const QColor &bg,
QTextDocument *document) :
VcsBase::BaseAnnotationHighlighter(changeNumbers, bg, document),
VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
m_blank(QLatin1Char(' '))
{
}
......
......@@ -40,7 +40,7 @@ class GitAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter
{
Q_OBJECT
public:
explicit GitAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg,
explicit GitAnnotationHighlighter(const ChangeNumbers &changeNumbers,
QTextDocument *document = 0);
private:
......
......@@ -107,10 +107,9 @@ QString GitEditor::changeUnderCursor(const QTextCursor &c) const
return QString();
}
VcsBase::BaseAnnotationHighlighter *GitEditor::createAnnotationHighlighter(const QSet<QString> &changes,
const QColor &bg) const
VcsBase::BaseAnnotationHighlighter *GitEditor::createAnnotationHighlighter(const QSet<QString> &changes) const
{
return new GitAnnotationHighlighter(changes, bg);
return new GitAnnotationHighlighter(changes);
}
/* Remove the date specification from annotation, which is tabular:
......
......@@ -63,7 +63,7 @@ private:
bool open(QString *errorString, const QString &fileName, const QString &realFileName);
QSet<QString> annotationChanges() const;
QString changeUnderCursor(const QTextCursor &) const;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes, const QColor &bg) const;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const;
QString decorateVersion(const QString &revision) const;
QStringList annotationPreviousVersions(const QString &revision) const;
bool isValidRevision(const QString &revision) const;
......
......@@ -27,9 +27,7 @@
**
****************************************************************************/
#include <texteditor/fontsettings.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/texteditorsettings.h>
#include <utils/qtcassert.h>
......@@ -40,13 +38,6 @@ namespace Internal {
static const char CHANGE_PATTERN[] = "\\b[a-f0-9]{7,40}\\b";
// Retrieve the comment char format from the text editor.
static QTextCharFormat commentFormat()