default boolean hasSelection(boolean anyCaret) {
    if (!anyCaret) {
      return getEditor().getCaretModel().getCurrentCaret().hasSelection();
    }
    for (Caret caret : getEditor().getCaretModel().getAllCarets()) {
      if (caret.hasSelection()) {
        return true;
      }
    }
    return false;
  }
default boolean hasSelection(boolean anyCaret)