コード例 #1
0
  @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--;
    }
  }
コード例 #2
0
 @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--;
   }
 }