diff --git a/src/plugins/diffeditor/unifieddiffeditorwidget.cpp b/src/plugins/diffeditor/unifieddiffeditorwidget.cpp index 89ec994de82..1d6221e6885 100644 --- a/src/plugins/diffeditor/unifieddiffeditorwidget.cpp +++ b/src/plugins/diffeditor/unifieddiffeditorwidget.cpp @@ -545,10 +545,6 @@ void UnifiedDiffEditorWidget::showDiff() setTextDocument(doc); setReadOnly(true); - - QTextBlock block = document()->firstBlock(); - for (int b = 0; block.isValid(); block = block.next(), ++b) - setFoldingIndent(block, result.foldingIndent.value(b, 3)); } setSelections(result.selections); } @@ -574,7 +570,7 @@ void UnifiedDiffEditorWidget::showDiff() return; const ShowResult result = {TextDocumentPtr(new TextDocument("DiffEditor.UnifiedDiffEditor")), - diffData, output.foldingIndent, output.selections}; + diffData, output.selections}; // No need to store the change history result.textDocument->document()->setUndoRedoEnabled(false); @@ -595,6 +591,10 @@ void UnifiedDiffEditorWidget::showDiff() return; } + QTextBlock block = result.textDocument->document()->firstBlock(); + for (int b = 0; block.isValid(); block = block.next(), ++b) + setFoldingIndent(block, output.foldingIndent.value(b, 3)); + // If future was canceled, the destructor runs in this thread, so we can't move it // to caller's thread. We push it to no thread (make object to have no thread affinity), // and later, in the caller's thread, we pull it back to the caller's thread. diff --git a/src/plugins/diffeditor/unifieddiffeditorwidget.h b/src/plugins/diffeditor/unifieddiffeditorwidget.h index 74c769face6..a71af995bb1 100644 --- a/src/plugins/diffeditor/unifieddiffeditorwidget.h +++ b/src/plugins/diffeditor/unifieddiffeditorwidget.h @@ -115,7 +115,6 @@ private: { QSharedPointer textDocument; UnifiedDiffData diffData; - QHash foldingIndent; DiffSelections selections; };