forked from qt-creator/qt-creator
CppEditor: Fix folding
The brace depth wasn't explicitly saved as block state and thus got reset to 0. Task-number: QTCREATORBUG-11566 Change-Id: I6c4f3c3392c01d65d7037c4723701ca8935ff70e Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -94,7 +94,7 @@ void CppHighlighter::highlightBlock(const QString &text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tokens.isEmpty()) {
|
if (tokens.isEmpty()) {
|
||||||
setCurrentBlockState(state);
|
setCurrentBlockState((braceDepth << 8) | state);
|
||||||
BaseTextDocumentLayout::clearParentheses(currentBlock());
|
BaseTextDocumentLayout::clearParentheses(currentBlock());
|
||||||
if (text.length()) {// the empty line can still contain whitespace
|
if (text.length()) {// the empty line can still contain whitespace
|
||||||
if (initialState == T_COMMENT)
|
if (initialState == T_COMMENT)
|
||||||
|
|||||||
Reference in New Issue
Block a user