@Override
 public void onFoldProcessingEnd() {
   myUpdateInProgress = false;
   if (!isSoftWrappingEnabled()) {
     return;
   }
   executeSafely(myFoldProcessingEndTask);
 }
 @Override
 public void onFoldProcessingEnd() {
   myUpdateInProgress = false;
   if (!isSoftWrappingEnabled()) {
     return;
   }
   if (myEditor.myUseNewRendering) {
     myFoldProcessingEndTask.run(true);
   } else {
     executeSafely(myFoldProcessingEndTask);
   }
 }
 @Override
 public int logicalPositionToOffset(@NotNull LogicalPosition logicalPosition) {
   if (myBulkUpdateInProgress || myUpdateInProgress || !prepareToMapping()) {
     return myEditor.logicalPositionToOffset(logicalPosition, false);
   }
   myActive++;
   try {
     myLogicalToOffsetTask.input = logicalPosition;
     executeSafely(myLogicalToOffsetTask);
     return myLogicalToOffsetTask.output;
   } finally {
     myActive--;
   }
 }
  @NotNull
  public LogicalPosition adjustLogicalPosition(LogicalPosition defaultLogical, int offset) {
    if (myBulkUpdateInProgress || myUpdateInProgress || !prepareToMapping()) {
      return defaultLogical;
    }

    myActive++;
    try {
      myOffsetToLogicalTask.input = offset;
      executeSafely(myOffsetToLogicalTask);
      return myOffsetToLogicalTask.output;
    } finally {
      myActive--;
    }
  }
 @NotNull
 @Override
 public LogicalPosition offsetToLogicalPosition(int offset) {
   if (myBulkUpdateInProgress || myUpdateInProgress || !prepareToMapping()) {
     return myEditor.offsetToLogicalPosition(offset, false);
   }
   myActive++;
   try {
     myOffsetToLogicalTask.input = offset;
     executeSafely(myOffsetToLogicalTask);
     return myOffsetToLogicalTask.output;
   } finally {
     myActive--;
   }
 }
 @NotNull
 @Override
 public LogicalPosition visualToLogicalPosition(@NotNull VisualPosition visual) {
   if (myBulkUpdateInProgress || myUpdateInProgress || !prepareToMapping()) {
     return myEditor.visualToLogicalPosition(visual, false);
   }
   myActive++;
   try {
     myVisualToLogicalTask.input = visual;
     executeSafely(myVisualToLogicalTask);
     return myVisualToLogicalTask.output;
   } finally {
     myActive--;
   }
 }
Ejemplo n.º 7
0
  @NotNull
  public VisualPosition adjustVisualPosition(
      @NotNull LogicalPosition logical, @NotNull VisualPosition defaultVisual) {
    if (myUpdateInProgress || !prepareToMapping()) {
      return defaultVisual;
    }

    myActive++;
    try {
      myLogicalToVisualTask.input = logical;
      myLogicalToVisualTask.defaultOutput = defaultVisual;
      executeSafely(myLogicalToVisualTask);
      return myLogicalToVisualTask.output;
    } finally {
      myActive--;
    }
  }