aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2002-05-20 07:44:39 +0000
committernyamatongwe <unknown>2002-05-20 07:44:39 +0000
commit3723e64117215e5a4404e530b339137e86ebaf2e (patch)
tree88e5b8d06cf75dff05f7dff33c121e1c18552400 /src
parent94b85e1fad1ca53b56fa1e1d41c5627849603b27 (diff)
downloadscintilla-mirror-3723e64117215e5a4404e530b339137e86ebaf2e.tar.gz
Fold #if as well as #region but require fold.preprocessor property to be set to allow folding preprocessor directives.
Diffstat (limited to 'src')
-rw-r--r--src/LexCPP.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx
index 85dcd42e8..e8462525a 100644
--- a/src/LexCPP.cxx
+++ b/src/LexCPP.cxx
@@ -273,6 +273,7 @@ static bool IsStreamCommentStyle(int style) {
static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordList *[],
Accessor &styler) {
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
unsigned int endPos = startPos + length;
int visibleChars = 0;
@@ -307,15 +308,15 @@ static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordLis
}
}
}
- if (style == SCE_C_PREPROCESSOR) {
+ if (foldPreprocessor && (style == SCE_C_PREPROCESSOR)) {
if (ch == '#') {
unsigned int j=i+1;
while ((j<endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
j++;
}
- if (styler.Match(j, "region")) {
+ if (styler.Match(j, "region") || styler.Match(j, "if")) {
levelCurrent++;
- } else if (styler.Match(j, "endregion")) {
+ } else if (styler.Match(j, "end")) {
levelCurrent--;
}
}