aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2013-03-07 12:39:44 +1100
committernyamatongwe <devnull@localhost>2013-03-07 12:39:44 +1100
commitf05792129505d74ff7cf3ab5e4768549d5b9709f (patch)
tree1d32a578183b0f9ae683d25add20c07a6cf22b0f
parent124b2f79616f21eb4189a45bead308c628b56242 (diff)
downloadscintilla-mirror-f05792129505d74ff7cf3ab5e4768549d5b9709f.tar.gz
Bug: [#482]. Refix to make /// comment not affect folding of following /* comment.
-rw-r--r--lexers/LexCPP.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index a064328c8..4f3b4f509 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -1041,6 +1041,7 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,
unsigned int endPos = startPos + length;
int visibleChars = 0;
+ bool inLineComment = false;
int lineCurrent = styler.GetLine(startPos);
int levelCurrent = SC_FOLDLEVELBASE;
if (lineCurrent > 0)
@@ -1059,10 +1060,12 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,
style = styleNext;
styleNext = MaskActive(styler.StyleAt(i + 1));
bool atEOL = i == (lineStartNext-1);
- if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style)) {
- if (!IsStreamCommentStyle(stylePrev) && (stylePrev != SCE_C_COMMENTLINEDOC)) {
+ if ((style == SCE_C_COMMENTLINE) || (style == SCE_C_COMMENTLINEDOC))
+ inLineComment = true;
+ if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style) && !inLineComment) {
+ if (!IsStreamCommentStyle(stylePrev)) {
levelNext++;
- } else if (!IsStreamCommentStyle(styleNext) && (styleNext != SCE_C_COMMENTLINEDOC) && !atEOL) {
+ } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
// Comments don't end at end of line and the next character may be unstyled.
levelNext--;
}
@@ -1134,6 +1137,7 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle,
styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
}
visibleChars = 0;
+ inLineComment = false;
}
}
}