From 21e3fb4e554e3b8370b2fcd31be897aaf6e6911b Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 17 Jul 2010 10:41:10 +1000 Subject: Patch from Nick Treleaven to allow disabling explicit fold points. --- lexers/LexCPP.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index 046607c40..ce8c39360 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -189,6 +189,7 @@ struct OptionsCPP { bool trackPreprocessor; bool updatePreprocessor; bool foldComment; + bool foldCommentExplicit; bool foldPreprocessor; bool foldCompact; bool foldAtElse; @@ -198,6 +199,7 @@ struct OptionsCPP { trackPreprocessor = true; updatePreprocessor = true; foldComment = false; + foldCommentExplicit = true; foldPreprocessor = false; foldCompact = false; foldAtElse = false; @@ -234,6 +236,9 @@ struct OptionSetCPP : public OptionSet { "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 @@ void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle, 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 == '{') { -- cgit v1.2.3