private static boolean shouldPasteOnPreviousLine(final @NotNull PsiFile file, @NotNull String text, int caretOffset) {
    final boolean useTabs = PyIndentUtil.areTabsUsedForIndentation(file);
    final PsiElement nonWS = PyUtil.findNextAtOffset(file, caretOffset, PsiWhiteSpace.class);
    if (nonWS == null || text.endsWith("\n")) {
      return true;
    }
    if (inStatementList(file, caretOffset) && (text.startsWith(useTabs ? "\t" : " ") || StringUtil.split(text, "\n").size() > 1)) {
      return true;
    }
    return false;
  }
private static boolean shouldPasteOnPreviousLine(final @NotNull PsiFile file, @NotNull String text, int caretOffset)