diff options
author | nyamatongwe <devnull@localhost> | 2002-04-05 07:03:05 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2002-04-05 07:03:05 +0000 |
commit | dbae5814b486802378c41ca4c095d0aa6dfcff86 (patch) | |
tree | 16aa5eff7d1aeeb10386afa33e825ea87bbf2639 | |
parent | 490d4317dd6d0ad5e913150cb0a606faaa826083 (diff) | |
download | scintilla-mirror-dbae5814b486802378c41ca4c095d0aa6dfcff86.tar.gz |
Fixed folding problem when keywords appeared in document comments.
-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--; } |