@Override
  public @NotNull String preprocessOnPaste(Project project, PsiFile file, Editor editor, String text, RawText rawText) {
    if (!file.getViewProvider().hasLanguage(YAMLLanguage.INSTANCE)) return text;
    CaretModel caretModel = editor.getCaretModel();
    SelectionModel selectionModel = editor.getSelectionModel();
    int caretOffset = selectionModel.getSelectionStart() != selectionModel.getSelectionEnd() ?
                      selectionModel.getSelectionStart() : caretModel.getOffset();
    if (isCommentElement(file.findElementAt(caretOffset))) return text;

    Document document = editor.getDocument();
    int lineNumber = document.getLineNumber(caretOffset);
    int lineStartOffset = YAMLTextUtil.getLineStartSafeOffset(document, lineNumber);
    int indent = caretOffset - lineStartOffset;

    boolean smartPaste = YAMLEditorOptions.getInstance().isUseSmartPaste();
    String specialKeyPaste = smartPaste ? tryToPasteAsKeySequence(text, file, editor, caretOffset, indent) : null;
    if (specialKeyPaste != null) {
      return specialKeyPaste;
    }

    // It could be copy and paste of lines
    // User could fix indentation later if he wanted to copy some block into top-level block
    if (indent == 0) {
      return text;
    }

    LineAdjustmentMode adjustmentMode = adjustmentAfterInsertion(file, caretOffset);
    if (adjustmentMode == LineAdjustmentMode.None) {
      return text;
    }

    if (adjustmentMode == LineAdjustmentMode.Indent) {
      return indentText(text, StringUtil.repeatSymbol(' ', indent), shouldInsertIndentAtTheEnd(caretOffset, document));
    }

    List<String> lines = LineTokenizer.tokenizeIntoList(text, false, false);
    if (lines.isEmpty()) {
      return text;
    }

    String firstLine = lines.get(0);

    // we are inserting a yaml fragment into a value
    // we don't turn the remaining lines into sequence items, just reindent them
    if (firstLine.trim().endsWith(":")) {
      return indentText(text, StringUtil.repeatSymbol(' ', indent), shouldInsertIndentAtTheEnd(caretOffset, document));
    }

    // if we have separate lines pasted into a sequence, turn each line into a sequence item
    return adjustListItems(lines, indent + fixOffset(document, caretOffset));
  }
@Override
  public @NotNull String preprocessOnPaste(Project project, PsiFile file, Editor editor, String text, RawText rawText)