@Nullable
  private static Editor getEditor(@NotNull AnActionEvent e) {
    Editor editor = e.getData(CommonDataKeys.EDITOR);
    if (editor != null) return editor;

    Project project = e.getProject();
    if (project == null) return null;
    return FileEditorManager.getInstance(project).getSelectedTextEditor();
  }
@Nullable
  private static Editor getEditor(@NotNull AnActionEvent e)