private static @Nullable SelectionToCopy prepareSelectionToCopy(@NotNull Editor editor) {
    boolean moveCaretToSelectionStart = isCopyFromEmptySelectionToMoveCaretToLineStart();
    boolean preserveOriginalCaretState = !isCopyFromEmptySelectionToSelectLine();
    return prepareSelectionToCopy(editor, moveCaretToSelectionStart, preserveOriginalCaretState);
  }
private static @Nullable SelectionToCopy prepareSelectionToCopy(@NotNull Editor editor)