aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/SciLexer.h7
-rw-r--r--include/Scintilla.iface8
-rw-r--r--src/LexOthers.cxx18
3 files changed, 25 insertions, 8 deletions
diff --git a/include/SciLexer.h b/include/SciLexer.h
index fb77a702e..0022606c2 100644
--- a/include/SciLexer.h
+++ b/include/SciLexer.h
@@ -281,6 +281,13 @@
#define SCE_MAKE_OPERATOR 4
#define SCE_MAKE_TARGET 5
#define SCE_MAKE_IDEOL 9
+#define SCE_DIFF_DEFAULT 0
+#define SCE_DIFF_COMMENT 1
+#define SCE_DIFF_COMMAND 2
+#define SCE_DIFF_HEADER 3
+#define SCE_DIFF_POSITION 4
+#define SCE_DIFF_DELETED 5
+#define SCE_DIFF_ADDED 6
#define SCE_CONF_DEFAULT 0
#define SCE_CONF_COMMENT 1
#define SCE_CONF_NUMBER 2
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 62c8f59cf..4d1c94818 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -1605,6 +1605,14 @@ val SCE_MAKE_IDENTIFIER=3
val SCE_MAKE_OPERATOR=4
val SCE_MAKE_TARGET=5
val SCE_MAKE_IDEOL=9
+# Lexical states for SCLEX_DIFF
+val SCE_DIFF_DEFAULT=0
+val SCE_DIFF_COMMENT=1
+val SCE_DIFF_COMMAND=2
+val SCE_DIFF_HEADER=3
+val SCE_DIFF_POSITION=4
+val SCE_DIFF_DELETED=5
+val SCE_DIFF_ADDED=6
# Lexical states for the SCLEX_CONF (Apache Configuration Files Lexer)
val SCE_CONF_DEFAULT=0
val SCE_CONF_COMMENT=1
diff --git a/src/LexOthers.cxx b/src/LexOthers.cxx
index f188722ff..8a035089c 100644
--- a/src/LexOthers.cxx
+++ b/src/LexOthers.cxx
@@ -159,21 +159,23 @@ static void ColouriseDiffLine(char *lineBuffer, int endLine, Accessor &styler) {
// difference starts then each line starting with ' ' is a whitespace
// otherwise it is considered a comment (Only in..., Binary file...)
if (0 == strncmp(lineBuffer, "diff ", 3)) {
- styler.ColourTo(endLine, 2);
+ styler.ColourTo(endLine, SCE_DIFF_COMMAND);
} else if (0 == strncmp(lineBuffer, "--- ", 3)) {
- styler.ColourTo(endLine, 3);
+ styler.ColourTo(endLine, SCE_DIFF_HEADER);
} else if (0 == strncmp(lineBuffer, "+++ ", 3)) {
- styler.ColourTo(endLine, 3);
+ styler.ColourTo(endLine, SCE_DIFF_HEADER);
+ } else if (0 == strncmp(lineBuffer, "***", 3)) {
+ styler.ColourTo(endLine, SCE_DIFF_HEADER);
} else if (lineBuffer[0] == '@') {
- styler.ColourTo(endLine, 4);
+ styler.ColourTo(endLine, SCE_DIFF_POSITION);
} else if (lineBuffer[0] == '-') {
- styler.ColourTo(endLine, 5);
+ styler.ColourTo(endLine, SCE_DIFF_DELETED);
} else if (lineBuffer[0] == '+') {
- styler.ColourTo(endLine, 6);
+ styler.ColourTo(endLine, SCE_DIFF_ADDED);
} else if (lineBuffer[0] != ' ') {
- styler.ColourTo(endLine, 1);
+ styler.ColourTo(endLine, SCE_DIFF_COMMENT);
} else {
- styler.ColourTo(endLine, 0);
+ styler.ColourTo(endLine, SCE_DIFF_DEFAULT);
}
}