void textLayoutPerformed(int startOffset, int endOffset) { if (myDocument.isInBulkUpdate()) return; if (myEditor.getFoldingModel().isInBatchFoldingOperation()) { myDeferredRanges.add(new TextRange(startOffset, endOffset)); } else { onTextLayoutPerformed(startOffset, endOffset); } }
@Override public void onFoldProcessingEnd() { if (myDocument.isInBulkUpdate()) return; if (myFoldingChangeStartOffset <= myFoldingChangeEndOffset) { doInvalidateRange(myFoldingChangeStartOffset, myFoldingChangeEndOffset); } myFoldingChangeStartOffset = Integer.MAX_VALUE; myFoldingChangeEndOffset = Integer.MIN_VALUE; for (TextRange range : myDeferredRanges) { onTextLayoutPerformed(range.getStartOffset(), range.getEndOffset()); } myDeferredRanges.clear(); assertValidState(); }