cleanup after batch folding operation end even in case of exception: to avoid observing invalid fold regions on subsequent batch folding operations

This commit is contained in:
Maxim.Mossienko
2014-02-27 18:18:48 +01:00
parent d63786dea4
commit a0f4efcd3d
@@ -212,17 +212,20 @@ public class FoldingModelImpl implements FoldingModelEx, PrioritizedDocumentList
myIsBatchFoldingProcessing = true;
myFoldTree.myCachedLastIndex = -1;
operation.run();
myFoldTree.myCachedLastIndex = -1;
try {
operation.run();
} finally {
myFoldTree.myCachedLastIndex = -1;
if (!oldBatchFlag) {
if (myFoldRegionsProcessed) {
notifyBatchFoldingProcessingDone(moveCaret);
myFoldRegionsProcessed = false;
if (!oldBatchFlag) {
if (myFoldRegionsProcessed) {
notifyBatchFoldingProcessingDone(moveCaret);
myFoldRegionsProcessed = false;
}
myIsBatchFoldingProcessing = false;
}
myIsBatchFoldingProcessing = false;
myDoNotCollapseCaret = oldDontCollapseCaret;
}
myDoNotCollapseCaret = oldDontCollapseCaret;
}
@Override