diff options
author | nyamatongwe <unknown> | 2011-04-05 08:43:01 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2011-04-05 08:43:01 +1000 |
commit | 0f4acb26a5c0ea7f2d233418ba30900e5e141980 (patch) | |
tree | c9805cfc35e1d8cc2646d50ee150949b9613d24c | |
parent | 8a9d7a36c478c6b2dce625835f46e47a503267ae (diff) | |
download | scintilla-mirror-0f4acb26a5c0ea7f2d233418ba30900e5e141980.tar.gz |
Adds a fold.perl.at.else property. Discussed in bug #3265401.
-rw-r--r-- | lexers/LexPerl.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lexers/LexPerl.cxx b/lexers/LexPerl.cxx index 310305fd5..67b8103ba 100644 --- a/lexers/LexPerl.cxx +++ b/lexers/LexPerl.cxx @@ -310,13 +310,15 @@ struct OptionsPerl { bool foldComment; bool foldCompact; // Custom folding of POD and packages - bool foldPOD; // property fold.perl.pod + bool foldPOD; // fold.perl.pod // Enable folding Pod blocks when using the Perl lexer. - bool foldPackage; // property fold.perl.package + bool foldPackage; // fold.perl.package // Enable folding packages when using the Perl lexer. bool foldCommentExplicit; + bool foldAtElse; + OptionsPerl() { fold = false; foldComment = false; @@ -324,6 +326,7 @@ struct OptionsPerl { foldPOD = true; foldPackage = true; foldCommentExplicit = true; + foldAtElse = false; } }; @@ -349,6 +352,9 @@ struct OptionSetPerl : public OptionSet<OptionsPerl> { DefineProperty("fold.perl.comment.explicit", &OptionsPerl::foldCommentExplicit, "Set to 0 to disable explicit folding."); + DefineProperty("fold.perl.at.else", &OptionsPerl::foldAtElse, + "This option enables Perl folding on a \"} else {\" line of an if statement."); + DefineWordListSets(perlWordListDesc); } }; @@ -1388,14 +1394,14 @@ void SCI_METHOD LexerPerl::Fold(unsigned int startPos, int length, int /* initSt // {} [] block folding if (style == SCE_PL_OPERATOR) { if (ch == '{') { - if (levelCurrent < levelPrev) + if (options.foldAtElse && levelCurrent < levelPrev) --levelPrev; levelCurrent++; } else if (ch == '}') { levelCurrent--; } if (ch == '[') { - if (levelCurrent < levelPrev) + if (options.foldAtElse && levelCurrent < levelPrev) --levelPrev; levelCurrent++; } else if (ch == ']') { |