From 3f1901cb1f42c896d9f256937c5a3a4ceeca4501 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 2 Jun 2013 23:05:51 +0300 Subject: Git: Provide a real highlighter for interactive rebase * Kate highlighter doesn't have enough colors * It works out of the box only on Windows * New editor support links Change-Id: I09bbaef08574660e535ccb86c2c460d5976fc2e3 Reviewed-by: Tobias Hunger --- src/plugins/git/giteditor.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/plugins/git/giteditor.cpp') diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index dcec98434b..165b1e7998 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -232,14 +232,19 @@ void GitEditor::revertChange() void GitEditor::init() { VcsBase::VcsBaseEditorWidget::init(); - if (editor()->id() == Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID) + Core::Id editorId = editor()->id(); + if (editorId == Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID) new GitSubmitHighlighter(baseTextDocument().data()); + else if (editorId == Git::Constants::GIT_REBASE_EDITOR_ID) + new GitRebaseHighlighter(baseTextDocument().data()); } bool GitEditor::open(QString *errorString, const QString &fileName, const QString &realFileName) { bool res = VcsBaseEditorWidget::open(errorString, fileName, realFileName); - if (editor()->id() == Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID) { + Core::Id editorId = editor()->id(); + if (editorId == Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID + || editorId == Git::Constants::GIT_REBASE_EDITOR_ID) { QFileInfo fi(fileName); setSource(GitPlugin::instance()->gitClient()->findRepositoryForGitDir(fi.absolutePath())); } @@ -298,7 +303,8 @@ QString GitEditor::revisionSubject(const QTextBlock &inBlock) const bool GitEditor::supportChangeLinks() const { return VcsBaseEditorWidget::supportChangeLinks() - || (editor()->id() == Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID); + || (editor()->id() == Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID) + || (editor()->id() == Git::Constants::GIT_REBASE_EDITOR_ID); } } // namespace Internal -- cgit v1.2.1