public static boolean checkMaxCarets(@NotNull Editor editor) {
    return ReadAction.compute(() -> {
      CaretModel caretModel = editor.getCaretModel();
      if (caretModel.getCaretCount() >= caretModel.getMaxCaretCount()) {
        notifyMaxCarets(editor);
        return true;
      }
      return false;
    });
  }
public static boolean checkMaxCarets(@NotNull Editor editor)