Exemple #1
0
 void invalidateRange(int startOffset, int endOffset) {
   if (myDocument.isInBulkUpdate()) return;
   if (myDocument.isInEventsHandling()) {
     myDocumentChangeStartOffset = Math.min(myDocumentChangeStartOffset, startOffset);
     myDocumentChangeEndOffset = Math.max(myDocumentChangeEndOffset, endOffset);
   } else if (myFoldingChangeEndOffset != Integer.MIN_VALUE) {
     // during batch folding processing we delay invalidation requests, as we cannot perform
     // coordinate conversions immediately
     myFoldingChangeStartOffset = Math.min(myFoldingChangeStartOffset, startOffset);
     myFoldingChangeEndOffset = Math.max(myFoldingChangeEndOffset, endOffset);
   } else {
     doInvalidateRange(startOffset, endOffset);
   }
 }
Exemple #2
0
  @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();
  }
Exemple #3
0
 private void onSoftWrapRecalculationEnd(IncrementalCacheUpdateEvent event) {
   if (myDocument.isInBulkUpdate()) return;
   boolean invalidate = true;
   if (myEditor.getFoldingModel().isInBatchFoldingOperation()) {
     myFoldingChangeStartOffset = Math.min(myFoldingChangeStartOffset, event.getStartOffset());
     myFoldingChangeEndOffset = Math.max(myFoldingChangeEndOffset, event.getActualEndOffset());
     invalidate = false;
   }
   if (myDocument.isInEventsHandling()) {
     myDocumentChangeStartOffset = Math.min(myDocumentChangeStartOffset, event.getStartOffset());
     myDocumentChangeEndOffset = Math.max(myDocumentChangeEndOffset, event.getActualEndOffset());
     invalidate = false;
   }
   if (invalidate) {
     doInvalidateRange(event.getStartOffset(), event.getActualEndOffset());
   }
 }
Exemple #4
0
 void reset() {
   assert !myDocument.isInBulkUpdate();
   doInvalidateRange(0, myDocument.getTextLength());
 }
Exemple #5
0
 @Override
 public void documentChanged(DocumentEvent event) {
   if (myDocument.isInBulkUpdate()) return;
   doInvalidateRange(myDocumentChangeStartOffset, myDocumentChangeEndOffset);
   assertValidState();
 }