@Override public void onFoldRegionStateChange(@NotNull FoldRegion region) { if (myDocument.isInBulkUpdate()) return; if (region.isValid()) { myFoldingChangeStartOffset = Math.min(myFoldingChangeStartOffset, region.getStartOffset()); myFoldingChangeEndOffset = Math.max(myFoldingChangeEndOffset, region.getEndOffset()); } }
public int getEndOffset(@NotNull FoldingGroup group) { final List<FoldRegion> regions = getGroupedRegions(group); int endOffset = 0; for (FoldRegion region : regions) { if (region.isValid()) { endOffset = Math.max(endOffset, region.getEndOffset()); } } return endOffset; }
@Override public void onFoldRegionStateChange(@NotNull FoldRegion region) { myUpdateInProgress = true; if (!isSoftWrappingEnabled() || !region.isValid()) { myDirty = true; return; } myDeferredFoldRegions.add(new FoldRegionInfo(region)); }
@Override public void onFoldRegionStateChange(@NotNull FoldRegion region) { myUpdateInProgress = true; if (!isSoftWrappingEnabled() || !region.isValid()) { myDirty = true; return; } // We delay processing of changed fold regions till the invocation of onFoldProcessingEnd(), as // FoldingModel can return inconsistent data before that moment. myDeferredFoldRegions.add(new TextRange(region.getStartOffset(), region.getEndOffset())); }