summaryrefslogtreecommitdiff
path: root/src/plugins/git/giteditor.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-06-02 23:05:51 +0300
committerOrgad Shaneh <orgads@gmail.com>2013-06-03 10:40:32 +0200
commit3f1901cb1f42c896d9f256937c5a3a4ceeca4501 (patch)
tree3b07fe677f5993be8e80201414e04ed8e4eb16f5 /src/plugins/git/giteditor.cpp
parent3e022beb1235cf74cc2bbe30711858bf5c47d433 (diff)
downloadqt-creator-3f1901cb1f42c896d9f256937c5a3a4ceeca4501.tar.gz
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 <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/git/giteditor.cpp')
-rw-r--r--src/plugins/git/giteditor.cpp12
1 files changed, 9 insertions, 3 deletions
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