diff: hide 'Prev/Next difference' actions if not available
[idea/community.git] / platform / diff-impl / src / com / intellij / diff / impl / DiffRequestProcessor.java
index a8d07656c78c60f8f619e2359cbc8bd1c565b207..ac9210e3059801cf4b828a066bf440c11d031cf1 100644 (file)
@@ -606,6 +606,12 @@ public abstract class DiffRequestProcessor implements Disposable {
       }
 
       PrevNextDifferenceIterable iterable = DiffDataKeys.PREV_NEXT_DIFFERENCE_ITERABLE.getData(e.getDataContext());
+      if (iterable == null && !isNavigationEnabled()) {
+        e.getPresentation().setEnabledAndVisible(false);
+        return;
+      }
+
+      e.getPresentation().setVisible(true);
       if (iterable != null && iterable.canGoNext()) {
         e.getPresentation().setEnabled(true);
         return;
@@ -650,6 +656,12 @@ public abstract class DiffRequestProcessor implements Disposable {
       }
 
       PrevNextDifferenceIterable iterable = DiffDataKeys.PREV_NEXT_DIFFERENCE_ITERABLE.getData(e.getDataContext());
+      if (iterable == null && !isNavigationEnabled()) {
+        e.getPresentation().setEnabledAndVisible(false);
+        return;
+      }
+
+      e.getPresentation().setVisible(true);
       if (iterable != null && iterable.canGoPrev()) {
         e.getPresentation().setEnabled(true);
         return;