public void restoreCaretPosition() {
    if (isVirtualSpaceEnabled()) {
      restoreVisualPosition();
    }
    else {
      restorePositionByIndentInsertion();
    }
  }
public void restoreCaretPosition()