forked from qt-creator/qt-creator
Fix: Folded code is deleted on save
Also fixes a crash when folding code at the very end of the document Task-number: QTCREATORBUG-2159
This commit is contained in:
@@ -527,7 +527,7 @@ void BaseTextDocumentLayout::doFoldOrUnfold(const QTextBlock& block, bool unfold
|
||||
QTextBlock b = block.next();
|
||||
|
||||
int indent = foldingIndent(block);
|
||||
while (b.isValid() && foldingIndent(b) > indent && b.next().isValid()) {
|
||||
while (b.isValid() && foldingIndent(b) > indent && (unfold || b.next().isValid())) {
|
||||
b.setVisible(unfold);
|
||||
b.setLineCount(unfold? qMax(1, b.layout()->lineCount()) : 0);
|
||||
if (unfold) { // do not unfold folded sub-blocks
|
||||
|
||||
Reference in New Issue
Block a user