@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.
    deferredFoldRegions.add(region.getTextRange()); // copy because region can become invalid later
  }
@Override
  public void onFoldRegionStateChange(@NotNull FoldRegion region)