dump permissions: don't ever start background dumb mode if someone requested it to...
authorpeter <peter@jetbrains.com>
Wed, 28 Oct 2015 17:08:31 +0000 (18:08 +0100)
committerpeter <peter@jetbrains.com>
Wed, 28 Oct 2015 17:52:54 +0000 (18:52 +0100)
platform/platform-impl/src/com/intellij/openapi/project/DumbPermissionServiceImpl.java

index 9573f9c11bde207a9058c684cbd266d423fd06de..4814f6cbf4c8be07c20d57615ec829b6367448ee 100644 (file)
@@ -27,6 +27,11 @@ public class DumbPermissionServiceImpl implements DumbPermissionService {
   @Override
   public void allowStartingDumbModeInside(@NotNull DumbModePermission permission, @NotNull Runnable runnable) {
     DumbModePermission prev = myPermission.get();
+    if (prev == DumbModePermission.MAY_START_MODAL && permission == DumbModePermission.MAY_START_BACKGROUND) {
+      runnable.run();
+      return;
+    }
+
     myPermission.set(permission);
     try {
       runnable.run();