diff options
author | Andreas Rönnquist <unknown> | 2018-05-28 14:23:41 +1000 |
---|---|---|
committer | Andreas Rönnquist <unknown> | 2018-05-28 14:23:41 +1000 |
commit | a9e99a64ab628e1044cc55d65a712a90af70d7a2 (patch) | |
tree | 0f9a13a352796e71f7944aeb2c6f3b9d5c6c2aa8 | |
parent | 39001aba9a3e181bacb6907da31a8bc8229aebf4 (diff) | |
download | scintilla-mirror-a9e99a64ab628e1044cc55d65a712a90af70d7a2.tar.gz |
Backport: Add styles for diffs containing patches.
Backport of changeset 7004:a1f932ccdee6.
-rw-r--r-- | doc/ScintillaHistory.html | 8 | ||||
-rw-r--r-- | include/SciLexer.h | 4 | ||||
-rw-r--r-- | include/Scintilla.iface | 4 | ||||
-rw-r--r-- | lexers/LexDiff.cxx | 8 |
4 files changed, 24 insertions, 0 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 014136c1f..9b1b9241c 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -521,6 +521,8 @@ <td>Dimitar Radev</td> <td>Gunter Königsmann</td> <td>Nicholai Benalal</td> + </tr><tr> + <td>Andreas Rönnquist</td> </tr> </table> <p> @@ -566,6 +568,12 @@ and ensure something is shown. </li> <li> + Diff lexer adds styles for diffs containing patches. + </li> + <li> + Regular expression crash fixed on macOS when linking to libstdc++. + </li> + <li> EDIFACT lexer adds property lexer.edifact.highlight.un.all to highlight all UN* segments. <a href="https://sourceforge.net/p/scintilla/feature-requests/1166/">Feature #1166.</a> </li> diff --git a/include/SciLexer.h b/include/SciLexer.h index 8772d8cb1..cde410f93 100644 --- a/include/SciLexer.h +++ b/include/SciLexer.h @@ -559,6 +559,10 @@ #define SCE_DIFF_DELETED 5 #define SCE_DIFF_ADDED 6 #define SCE_DIFF_CHANGED 7 +#define SCE_DIFF_PATCH_ADD 8 +#define SCE_DIFF_PATCH_DELETE 9 +#define SCE_DIFF_REMOVED_PATCH_ADD 10 +#define SCE_DIFF_REMOVED_PATCH_DELETE 11 #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 7e52a5777..d4d8ac78b 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -3423,6 +3423,10 @@ val SCE_DIFF_POSITION=4 val SCE_DIFF_DELETED=5 val SCE_DIFF_ADDED=6 val SCE_DIFF_CHANGED=7 +val SCE_DIFF_PATCH_ADD=8 +val SCE_DIFF_PATCH_DELETE=9 +val SCE_DIFF_REMOVED_PATCH_ADD=10 +val SCE_DIFF_REMOVED_PATCH_DELETE=11 # Lexical states for SCLEX_CONF (Apache Configuration Files Lexer) lex Conf=SCLEX_CONF SCE_CONF_ val SCE_CONF_DEFAULT=0 diff --git a/lexers/LexDiff.cxx b/lexers/LexDiff.cxx index f87538daa..dd008c5cb 100644 --- a/lexers/LexDiff.cxx +++ b/lexers/LexDiff.cxx @@ -78,6 +78,14 @@ static void ColouriseDiffLine(char *lineBuffer, Sci_Position endLine, Accessor & styler.ColourTo(endLine, SCE_DIFF_POSITION); } else if (lineBuffer[0] >= '0' && lineBuffer[0] <= '9') { styler.ColourTo(endLine, SCE_DIFF_POSITION); + } else if (0 == strncmp(lineBuffer, "++", 2)) { + styler.ColourTo(endLine, SCE_DIFF_PATCH_ADD); + } else if (0 == strncmp(lineBuffer, "+-", 2)) { + styler.ColourTo(endLine, SCE_DIFF_PATCH_DELETE); + } else if (0 == strncmp(lineBuffer, "-+", 2)) { + styler.ColourTo(endLine, SCE_DIFF_REMOVED_PATCH_ADD); + } else if (0 == strncmp(lineBuffer, "--", 2)) { + styler.ColourTo(endLine, SCE_DIFF_REMOVED_PATCH_DELETE); } else if (lineBuffer[0] == '-' || lineBuffer[0] == '<') { styler.ColourTo(endLine, SCE_DIFF_DELETED); } else if (lineBuffer[0] == '+' || lineBuffer[0] == '>') { |