Пример #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);
   }
 }
Пример #2
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());
   }
 }
 @Override
 public boolean isInEventsHandling() {
   return myDelegate.isInEventsHandling();
 }