public static boolean isEnabled(@NotNull Editor editor) {
    return editor.getSelectionModel().getSelectionStart() < editor.getSelectionModel().getSelectionEnd() ||
           FoldingUtil.getFoldRegionsAtOffset(editor, editor.getCaretModel().getOffset()).length > 0;
  }
public static boolean isEnabled(@NotNull Editor editor)