diff options
author | nyamatongwe <unknown> | 2010-07-17 10:41:10 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2010-07-17 10:41:10 +1000 |
commit | 21e3fb4e554e3b8370b2fcd31be897aaf6e6911b (patch) | |
tree | 1a442298c62f909456f2d544b782d6dde7befd6b /lexers/LexCPP.cxx | |
parent | 6ecb50e123e4fd7be3ce128306295d5acf58376d (diff) | |
download | scintilla-mirror-21e3fb4e554e3b8370b2fcd31be897aaf6e6911b.tar.gz |
Patch from Nick Treleaven to allow disabling explicit fold points.
Diffstat (limited to 'lexers/LexCPP.cxx')
-rw-r--r-- | lexers/LexCPP.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
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<OptionsCPP> { "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 == '{') { |