void doMoveToVisualPosition(@NotNull VisualPosition pos, boolean fireListeners) {
    assertIsDispatchThread();
    checkDisposal();
    assertNotUpdating();
    if (mySkipChangeRequests) {
      return;
    }
    if (!pos.equals(myVisibleCaret)) {
      stopKillRings();
    }
    updateCachedStateIfNeeded();

    myDesiredX = -1;
    int column = pos.column;
    int line = pos.line;
    boolean leanRight = pos.leansRight;

    int lastLine = myEditor.getVisibleLineCount() - 1;
    if (line > lastLine) {
      line = lastLine;
    }

    EditorSettings editorSettings = myEditor.getSettings();

    if (!editorSettings.isVirtualSpace()) {
      int lineEndColumn = EditorUtil.getLastVisualLineColumnNumber(myEditor, line);
      if (column > lineEndColumn && !myEditor.getSoftWrapModel().isInsideSoftWrap(pos)) {
        column = lineEndColumn;
        leanRight = true;
      }
    }

    VisualPosition oldVisualPosition = myVisibleCaret;
    myVisibleCaret = new VisualPosition(line, column, leanRight);

    VerticalInfo oldVerticalInfo = myVerticalInfo;
    LogicalPosition oldPosition = myLogicalCaret;
    boolean oldInVirtualSpace = isInVirtualSpace();

    myLogicalCaret = myEditor.visualToLogicalPosition(myVisibleCaret);
    VisualPosition mappedPosition = myEditor.logicalToVisualPosition(myLogicalCaret);
    myVisualColumnAdjustment = mappedPosition.line == myVisibleCaret.line && myVisibleCaret.column > mappedPosition.column ? myVisibleCaret.column - mappedPosition.column : 0;
    updateOffsetsFromLogicalPosition();

    updateVisualLineInfo();

    myEditor.getFoldingModel().flushCaretPosition(this);

    myColumnNumberForCloning = -1;
    myDesiredSelectionStartColumn = myDesiredSelectionEndColumn = -1;
    myEditor.updateCaretCursor();
    requestRepaint(oldVerticalInfo);

    if (!oldPosition.equals(myLogicalCaret) || !oldVisualPosition.equals(myVisibleCaret)) {
      if (oldInVirtualSpace || isInVirtualSpace()) {
        myCaretModel.validateEditorSize();
      }
      if (fireListeners) {
        CaretEvent event = new CaretEvent(this, oldPosition, myLogicalCaret);
        myCaretModel.fireCaretPositionChanged(event);
      }
    }
  }
void doMoveToVisualPosition(@NotNull VisualPosition pos, boolean fireListeners)