diff options
author | nyamatongwe <unknown> | 2002-04-05 07:03:05 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2002-04-05 07:03:05 +0000 |
commit | 244af93fb13a0c2ddc3cf9c620a6210d6d61079f (patch) | |
tree | 16aa5eff7d1aeeb10386afa33e825ea87bbf2639 /src/LexCPP.cxx | |
parent | 2ffc5af90180e0bbf09359bfde77780e4e26715b (diff) | |
download | scintilla-mirror-244af93fb13a0c2ddc3cf9c620a6210d6d61079f.tar.gz |
Fixed folding problem when keywords appeared in document comments.
Diffstat (limited to 'src/LexCPP.cxx')
-rw-r--r-- | src/LexCPP.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx index 40baea9dc..52af4de4c 100644 --- a/src/LexCPP.cxx +++ b/src/LexCPP.cxx @@ -263,6 +263,13 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo sc.Complete(); } +static bool IsStreamCommentStyle(int style) { + return style == SCE_C_COMMENT || + style == SCE_C_COMMENTDOC || + style == SCE_C_COMMENTDOCKEYWORD || + style == SCE_C_COMMENTDOCKEYWORDERROR; +} + static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; @@ -282,11 +289,10 @@ static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordLis style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); - if (foldComment && - (style == SCE_C_COMMENT || style == SCE_C_COMMENTDOC)) { - if (style != stylePrev) { + if (foldComment && IsStreamCommentStyle(style)) { + if (!IsStreamCommentStyle(stylePrev)) { levelCurrent++; - } else if ((style != styleNext) && !atEOL) { + } else if (!IsStreamCommentStyle(styleNext) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelCurrent--; } |