aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexCPP.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2010-08-07 08:44:04 +1000
committernyamatongwe <unknown>2010-08-07 08:44:04 +1000
commit37f01ccb6c5292529100ff2f46e0c7c0b12865c5 (patch)
tree6857ef67d792ad82edbc5b38848c4bbfb7dd1ea2 /lexers/LexCPP.cxx
parent25a04e7a1ceb690812120d48aa91cce7f3df53bf (diff)
downloadscintilla-mirror-37f01ccb6c5292529100ff2f46e0c7c0b12865c5.tar.gz
Made it possible to turn folding off again by looking at the "fold" property.
Diffstat (limited to 'lexers/LexCPP.cxx')
-rw-r--r--lexers/LexCPP.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index ce8c39360..588f42e6e 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -188,6 +188,7 @@ struct OptionsCPP {
bool identifiersAllowDollars;
bool trackPreprocessor;
bool updatePreprocessor;
+ bool fold;
bool foldComment;
bool foldCommentExplicit;
bool foldPreprocessor;
@@ -198,6 +199,7 @@ struct OptionsCPP {
identifiersAllowDollars = true;
trackPreprocessor = true;
updatePreprocessor = true;
+ fold = false;
foldComment = false;
foldCommentExplicit = true;
foldPreprocessor = false;
@@ -231,6 +233,8 @@ struct OptionSetCPP : public OptionSet<OptionsCPP> {
DefineProperty("lexer.cpp.update.preprocessor", &OptionsCPP::updatePreprocessor,
"Set to 1 to update preprocessor definitions when #define found.");
+ DefineProperty("fold", &OptionsCPP::fold);
+
DefineProperty("fold.comment", &OptionsCPP::foldComment,
"This option enables folding multi-line comments and explicit fold points when using the C++ lexer. "
"Explicit fold points allows adding extra folding by placing a //{ comment at the start and a //} "
@@ -800,6 +804,9 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+ if (!options.fold)
+ return;
+
LexAccessor styler(pAccess);
unsigned int endPos = startPos + length;