diff options
author | Colomban Wendling <ban@herbesfolles.org> | 2016-03-03 17:54:08 +0100 |
---|---|---|
committer | Colomban Wendling <ban@herbesfolles.org> | 2016-03-03 17:54:08 +0100 |
commit | c0adcee750d176581437eaaa40bc72ed4afaa5f9 (patch) | |
tree | 39d0be30d2f7e52191bf327c9a3eb3ae6de82498 | |
parent | cbf6678499517c431953d7ca959bac3273e013b5 (diff) | |
download | scintilla-mirror-c0adcee750d176581437eaaa40bc72ed4afaa5f9.tar.gz |
CPP: Add support for folding on `(` and `)`
Feature [feature-requests:#1138].
-rw-r--r-- | doc/ScintillaHistory.html | 4 | ||||
-rw-r--r-- | lexers/LexCPP.cxx | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index b3b417d19..4b73b1d18 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -505,6 +505,10 @@ SciTE allows setting the autocompletion type separator character. </li> <li> + The C++ folder folds code on '(' and ')' to allow multi-line calls to be folded. + <a href="http://sourceforge.net/p/scintilla/feature-requests/1138/">Feature #1138.</a> + </li> + <li> For the HTML lexer, limit the extent of Mako line comments to finish before the line end characters. </li> diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index fc9b5b86b..76190002a 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -1349,14 +1349,14 @@ void SCI_METHOD LexerCPP::Fold(Sci_PositionU startPos, Sci_Position length, int } } if (options.foldSyntaxBased && (style == SCE_C_OPERATOR)) { - if (ch == '{' || ch == '[') { + if (ch == '{' || ch == '[' || ch == '(') { // Measure the minimum before a '{' to allow // folding on "} else {" if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } levelNext++; - } else if (ch == '}' || ch == ']') { + } else if (ch == '}' || ch == ']' || ch == ')') { levelNext--; } } |