diff options
author | nyamatongwe <unknown> | 2001-03-28 03:24:23 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2001-03-28 03:24:23 +0000 |
commit | c677c39d261b17936d13c4d73f99a38c8f0aefef (patch) | |
tree | 9bb6e985ad8e8e0a413917af116ccc408072fa14 /src | |
parent | ee41ed3563d0b38a22bd1a881e95b07e238a5999 (diff) | |
download | scintilla-mirror-c677c39d261b17936d13c4d73f99a38c8f0aefef.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.
Diffstat (limited to 'src')
-rw-r--r-- | src/LexCPP.cxx | 10 |
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)) |