It seems you can disable explicit folding with:
fold.comment=0
But this also disables all folding of /* */ comments. (Maybe the FAQ
should mention this).
I think it would be great if there was an independent setting
like:
fold.comment.explicit=0
Please find patch attached - the property defaults to on if
fold.comment is enabled, so existing behaviour is preserved.
Thanks,
Nick
> Please find patch attached - the property defaults to on if
> fold.comment is enabled, so existing behaviour is preserved.
Due to the large scale changes to lexers currently underway for the
new lexer interface, I am not accepting patches until the new lexer
interface is committed to the mainline. I will look at this after that
happens.
The explanation could be misconstrued as fold.comment.explicit=1
ensuring folding of explicit folds whereas really it is a constraining
property. Perhaps something about fold.comment.explicit=0 disabling
the folding of explicit fold points when fold.comment=1.
Neil
Neil
> > Please find patch attached - the property defaults to on if
> > fold.comment is enabled, so existing behaviour is preserved.
>
> Due to the large scale changes to lexers currently underway for the
> new lexer interface, I am not accepting patches until the new lexer
> interface is committed to the mainline. I will look at this after that
> happens.
OK, no problem.
> The explanation could be misconstrued as fold.comment.explicit=1
> ensuring folding of explicit folds whereas really it is a constraining
> property. Perhaps something about fold.comment.explicit=0 disabling
> the folding of explicit fold points when fold.comment=1.
See new patch attached. The comment explains this now.
I renamed the property fold.cpp.comment.explicit as suggested in your
other mail.
Thanks,
Nick
>hg diff
diff -r e53b2cf7ef3f lexers/LexCPP.cxx
--- a/lexers/LexCPP.cxx Sat Jul 17 10:19:32 2010 +1000
+++ b/lexers/LexCPP.cxx Sat Jul 17 10:25:37 2010 +1000
@@ -189,6 +189,7 @@
bool trackPreprocessor;
bool updatePreprocessor;
bool foldComment;
+ bool foldCommentExplicit;
bool foldPreprocessor;
bool foldCompact;
bool foldAtElse;
@@ -198,6 +199,7 @@
trackPreprocessor = true;
updatePreprocessor = true;
foldComment = false;
+ foldCommentExplicit = true;
foldPreprocessor = false;
foldCompact = false;
foldAtElse = false;
@@ -234,6 +236,9 @@
"Explicit fold points allows adding extra folding by placing a //{
comment at the start and a //} "
"at the end of a section that should fold.");
+ DefineProperty("fold.cpp.comment.explicit", &OptionsCPP::foldCommentExplicit,
+ "Set this property to 0 to disable folding explicit fold points
when fold.comment=1.");
+
DefineProperty("fold.preprocessor", &OptionsCPP::foldPreprocessor,
"This option enables folding preprocessor directives when using
the C++ lexer. "
"Includes C#'s explicit #region and #endregion folding directives.");
@@ -823,7 +828,7 @@
levelNext--;
}
}
- if (options.foldComment && (style == SCE_C_COMMENTLINE)) {
+ if (options.foldComment && options.foldCommentExplicit && (style ==
SCE_C_COMMENTLINE)) {
if ((ch == '/') && (chNext == '/')) {
char chNext2 = styler.SafeGetCharAt(i + 2);
if (chNext2 == '{') {
Neil