@Override
  protected void actionPerformed(@NotNull Project p, @NotNull IdeaGateway gw, @NotNull AnActionEvent e) {
    VirtualFile f = ContainerUtil.getOnlyItem(getFiles(e));
    if (f == null) return;

    VcsSelection sel = Objects.requireNonNull(VcsSelectionUtil.getSelection(this, e));

    int from = sel.getSelectionStartLineNumber();
    int to = sel.getSelectionEndLineNumber();

    if (ActivityView.isViewEnabled()) {
      ActivityView.showInDialog(p, gw, new ActivityScope.Selection(f, from, to));
    }
    else {
      LocalHistoryCounter.INSTANCE.logLocalHistoryOpened(LocalHistoryCounter.Kind.Selection);
      new SelectionHistoryDialog(p, gw, f, from, to).show();
    }
  }
@Override
  protected void actionPerformed(@NotNull Project p, @NotNull IdeaGateway gw, @NotNull AnActionEvent e)