vcs: disable "annotate selected/previous revision" in modal context
authorAleksey Pivovarov <AMPivovarov@gmail.com>
Wed, 1 Jul 2015 13:24:41 +0000 (16:24 +0300)
committerAleksey Pivovarov <AMPivovarov@gmail.com>
Thu, 3 Sep 2015 16:28:10 +0000 (19:28 +0300)
they will open new editor, but user can't access it without leaving modal context

platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateRevisionAction.java

index 011d9c60e148b199cad78c930bb4506b5e134abf..7af79f9c7a1744aa887acfa704b110da8bf5ef27 100644 (file)
@@ -1,6 +1,7 @@
 package com.intellij.openapi.vcs.actions;
 
 import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.PlatformDataKeys;
 import com.intellij.openapi.fileTypes.FileType;
 import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.vcs.AbstractVcs;
@@ -34,6 +35,11 @@ abstract class AnnotateRevisionAction extends AnnotateRevisionActionBase impleme
 
   @Override
   public void update(@NotNull AnActionEvent e) {
+    if (Boolean.TRUE.equals(e.getData(PlatformDataKeys.IS_MODAL_CONTEXT))) {
+      e.getPresentation().setEnabledAndVisible(false);
+      return;
+    }
+
     if (getRevisions() == null) {
       e.getPresentation().setEnabledAndVisible(false);
       return;