aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2020-09-01 16:45:28 +0300
committerOrgad Shaneh <orgads@gmail.com>2020-09-07 08:32:37 +0000
commitf73f11d8c6418141581a77b97fc3c479a1bbaae5 (patch)
treea7aeeaeb4fab9473582a1aeaf8f3be15a020dd72
parent9c99aa223db8c9ae09c20387a82b23c03eee0e73 (diff)
Git: Highlight newly added keywords in interactive rebase editor
Change-Id: I571e9576fcb781fda4dc5ce2df8a6bbc3a8abf9e Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: David Schulz <david.schulz@qt.io>
-rw-r--r--src/plugins/git/githighlighters.cpp10
-rw-r--r--src/plugins/git/githighlighters.h5
2 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/git/githighlighters.cpp b/src/plugins/git/githighlighters.cpp
index 763a3b9f79..8a14293307 100644
--- a/src/plugins/git/githighlighters.cpp
+++ b/src/plugins/git/githighlighters.cpp
@@ -103,6 +103,11 @@ static TextEditor::TextStyle styleForFormat(int format)
case Format_Squash: return C_ENUMERATION;
case Format_Fixup: return C_NUMBER;
case Format_Exec: return C_LABEL;
+ case Format_Break: return C_PREPROCESSOR;
+ case Format_Drop: return C_REMOVED_LINE;
+ case Format_Label: return C_LABEL;
+ case Format_Reset: return C_LABEL;
+ case Format_Merge: return C_LABEL;
case Format_Count:
QTC_CHECK(false); // should never get here
return C_TEXT;
@@ -124,6 +129,11 @@ GitRebaseHighlighter::GitRebaseHighlighter(QTextDocument *parent) :
m_actions << RebaseAction("^(s|squash)\\b", Format_Squash);
m_actions << RebaseAction("^(f|fixup)\\b", Format_Fixup);
m_actions << RebaseAction("^(x|exec)\\b", Format_Exec);
+ m_actions << RebaseAction("^(b|break)\\b", Format_Break);
+ m_actions << RebaseAction("^(d|drop)\\b", Format_Drop);
+ m_actions << RebaseAction("^(l|label)\\b", Format_Label);
+ m_actions << RebaseAction("^(t|reset)\\b", Format_Reset);
+ m_actions << RebaseAction("^(m|merge)\\b", Format_Merge);
}
void GitRebaseHighlighter::highlightBlock(const QString &text)
diff --git a/src/plugins/git/githighlighters.h b/src/plugins/git/githighlighters.h
index 27ab98036e..edeb1a0d70 100644
--- a/src/plugins/git/githighlighters.h
+++ b/src/plugins/git/githighlighters.h
@@ -42,6 +42,11 @@ enum Format {
Format_Squash,
Format_Fixup,
Format_Exec,
+ Format_Break,
+ Format_Drop,
+ Format_Label,
+ Format_Reset,
+ Format_Merge,
Format_Count
};