diff --git a/platform/platform-api/src/com/intellij/ui/EditorNotifications.java b/platform/platform-api/src/com/intellij/ui/EditorNotifications.java index 375ec0431fc8..8cd47914d520 100644 --- a/platform/platform-api/src/com/intellij/ui/EditorNotifications.java +++ b/platform/platform-api/src/com/intellij/ui/EditorNotifications.java @@ -28,6 +28,7 @@ import com.intellij.openapi.project.ProjectManager; import com.intellij.openapi.util.Key; import com.intellij.openapi.util.NotNullLazyValue; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -73,17 +74,22 @@ public class EditorNotifications extends AbstractProjectComponent { } public void updateNotifications(final VirtualFile file) { - ApplicationManager.getApplication().runReadAction(new Runnable() { + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override public void run() { - if (myProject.isDisposed()) return; - FileEditor[] editors = myFileEditorManager.getAllEditors(file); - for (FileEditor editor : editors) { - for (Provider provider : PROVIDERS.getValue()) { - JComponent component = provider.createNotificationPanel(file, editor); - Key key = provider.getKey(); - updateNotification(editor, key, component); + ApplicationManager.getApplication().runReadAction(new Runnable() { + public void run() { + if (myProject.isDisposed()) return; + FileEditor[] editors = myFileEditorManager.getAllEditors(file); + for (FileEditor editor : editors) { + for (Provider provider : PROVIDERS.getValue()) { + JComponent component = provider.createNotificationPanel(file, editor); + Key key = provider.getKey(); + updateNotification(editor, key, component); + } + } } - } + }); } }); }