aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2001-03-28 03:24:23 +0000
committernyamatongwe <devnull@localhost>2001-03-28 03:24:23 +0000
commiteda2f33df37baeb7a3cffe6d43ee99712acebc2f (patch)
tree9bb6e985ad8e8e0a413917af116ccc408072fa14
parent09e2f2e2bcc1222b5689729a0a531436ac407e7a (diff)
downloadscintilla-mirror-eda2f33df37baeb7a3cffe6d43ee99712acebc2f.tar.gz
Changed handling of the end of stream comments which was perturbed by
changing way end of line was handled leading to shorter segments.
-rw-r--r--src/LexCPP.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx
index b019defa5..b6138b1ab 100644
--- a/src/LexCPP.cxx
+++ b/src/LexCPP.cxx
@@ -59,6 +59,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
int levelCurrent = levelPrev;
int state = initStyle;
+ int styleBeforeLineStart = initStyle;
if (state == SCE_C_STRINGEOL) // Does not leak onto next line
state = SCE_C_DEFAULT;
char chPrev = ' ';
@@ -187,8 +188,8 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
} else if (state == SCE_C_COMMENT) {
if (ch == '/' && chPrev == '*') {
if (((i > styler.GetStartSegment() + 2) || (
- (initStyle == SCE_C_COMMENT) &&
- (styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) {
+ (styleBeforeLineStart == SCE_C_COMMENT) &&
+ (i > styler.GetStartSegment())))) {
styler.ColourTo(i, state);
state = SCE_C_DEFAULT;
if (foldComment)
@@ -198,8 +199,8 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
} else if (state == SCE_C_COMMENTDOC) {
if (ch == '/' && chPrev == '*') {
if (((i > styler.GetStartSegment() + 2) || (
- (initStyle == SCE_C_COMMENTDOC) &&
- (styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) {
+ (styleBeforeLineStart == SCE_C_COMMENTDOC) &&
+ (i > styler.GetStartSegment())))) {
styler.ColourTo(i, state);
state = SCE_C_DEFAULT;
if (foldComment)
@@ -288,6 +289,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
lineCurrent++;
levelPrev = levelCurrent;
}
+ styleBeforeLineStart = state;
visibleChars = 0;
}
if (!isspacechar(ch))