From 453389e9d23c69309251252a27091fbcf0ff7f8a Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Wed, 26 Feb 2014 12:39:29 -0300 Subject: [PATCH] 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 --- src/plugins/cppeditor/cpphighlighter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp index d039b9e1477..7e9c7676c45 100644 --- a/src/plugins/cppeditor/cpphighlighter.cpp +++ b/src/plugins/cppeditor/cpphighlighter.cpp @@ -94,7 +94,7 @@ void CppHighlighter::highlightBlock(const QString &text) } if (tokens.isEmpty()) { - setCurrentBlockState(state); + setCurrentBlockState((braceDepth << 8) | state); BaseTextDocumentLayout::clearParentheses(currentBlock()); if (text.length()) {// the empty line can still contain whitespace if (initialState == T_COMMENT)