From 013bf48bff4164a02137b2e790bbed8b32c4e98e Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 22 Jan 2017 17:41:23 +1100 Subject: Correctly color code deleted lines starting with "--" This fixes the coloring of deleted lines in which starts with "--" such as closing HTML comments ("-->"). Signed-off-by: Sven Strickroth --- doc/ScintillaHistory.html | 3 +++ lexers/LexDiff.cxx | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 58743678e..0972070d6 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -525,6 +525,9 @@ Released 30 December 2016.
  • + The Diff lexer recognizes deleted lines that start with "--- ". +
  • +
  • The Lua lexer requires the first line to start with "#!" to be treated as a shebang comment, not just "#". Bug #1900. diff --git a/lexers/LexDiff.cxx b/lexers/LexDiff.cxx index baa8368f6..bfc22b9f6 100644 --- a/lexers/LexDiff.cxx +++ b/lexers/LexDiff.cxx @@ -51,8 +51,10 @@ static void ColouriseDiffLine(char *lineBuffer, Sci_Position endLine, Accessor & styler.ColourTo(endLine, SCE_DIFF_POSITION); else if (lineBuffer[3] == '\r' || lineBuffer[3] == '\n') styler.ColourTo(endLine, SCE_DIFF_POSITION); - else + else if (lineBuffer[3] == ' ') styler.ColourTo(endLine, SCE_DIFF_HEADER); + else + styler.ColourTo(endLine, SCE_DIFF_DELETED); } else if (0 == strncmp(lineBuffer, "+++ ", 4)) { // I don't know of any diff where "+++ " is a position marker, but for // consistency, do the same as with "--- " and "*** ". -- cgit v1.2.3