From 2777bbded86a96d6a82bd2dae905cd43c4cc83b3 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 4 Oct 2004 12:05:24 +0000 Subject: Patch from Carsten Sperber that colours line ends on comment and preprocessor lines in STYLE_DEFAULT rather than colouring first byte of line end in line style. --- doc/ScintillaHistory.html | 1 + src/LexCPP.cxx | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 1bc22f3cc..aa79a40df 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -177,6 +177,7 @@
  • Ben Key
  • Gene Barry
  • Niki Spahiev
  • +
  • Carsten Sperber
  • Images used in GTK+ version diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx index fedb978be..c6ca06505 100644 --- a/src/LexCPP.cxx +++ b/src/LexCPP.cxx @@ -123,7 +123,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo sc.SetState(SCE_C_DEFAULT); } } else { - if ((sc.atLineEnd) || (sc.Match('/', '*')) || (sc.Match('/', '/'))) { + if ((sc.ch == '\r') || (sc.ch == '\n') || (sc.Match('/', '*')) || (sc.Match('/', '/'))) { sc.SetState(SCE_C_DEFAULT); } } @@ -140,7 +140,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo sc.SetState(SCE_C_COMMENTDOCKEYWORD); } } else if (sc.state == SCE_C_COMMENTLINE || sc.state == SCE_C_COMMENTLINEDOC) { - if (sc.atLineEnd) { + if (sc.ch == '\r' || sc.ch == '\n') { sc.SetState(SCE_C_DEFAULT); visibleChars = 0; } @@ -253,7 +253,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo do { sc.Forward(); } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()); - if (sc.atLineEnd) { + if (sc.ch == '\r' || sc.ch == '\n') { sc.SetState(SCE_C_DEFAULT); } } else if (isoperator(static_cast(sc.ch))) { -- cgit v1.2.3