예제 #1
0
  /**
   * Encapsulates preparations for performing document dimension mapping (e.g. visual to logical
   * position) and answers if soft wraps-aware processing should be used (e.g. there is no need to
   * consider soft wraps if user configured them not to be used).
   *
   * @return <code>true</code> if soft wraps-aware processing should be used; <code>false</code>
   *     otherwise
   */
  private boolean prepareToMapping() {
    boolean useSoftWraps =
        myActive <= 0
            && isSoftWrappingEnabled()
            && myEditor.getDocument().getTextLength() > 0
            && myFoldBasedApplianceStrategy.processSoftWraps();

    if (!useSoftWraps) {
      return useSoftWraps;
    }

    if (myDirty) {
      myApplianceManager.reset();
      myDeferredFoldRegions.clear();
      myDirty = false;
    }

    myApplianceManager.recalculateIfNecessary();
    return true;
  }
예제 #2
0
 @Override
 public void setPlace(@NotNull SoftWrapAppliancePlaces place) {
   myFoldBasedApplianceStrategy.setCurrentPlace(place);
 }