[status bar] simplify getCurrentTextEditor method
authorAlexander Zolotov <zolotov@jetbrains.com>
Mon, 10 Aug 2020 09:13:27 +0000 (12:13 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Tue, 11 Aug 2020 13:56:28 +0000 (13:56 +0000)
Looks like getSelectedTextEditor does the same thing as getCurrentFileEditor with filtering by `TextEditor` class

GitOrigin-RevId: df591c5810d6e0e0f2e47445b9d7a327948aa4e4

platform/platform-impl/src/com/intellij/openapi/wm/impl/status/StatusBarUtil.java

index e4afe861758d1d082901a879d0ab6122a4cbead6..59e3cdfee83e3fe90c96c6ffc277e994195faf55 100644 (file)
@@ -41,17 +41,6 @@ public final class StatusBarUtil {
       Editor editor = ((TextEditor)fileEditor).getEditor();
       return ensureValidEditorFile(editor, fileEditor) ? editor : null;
     }
-
-    Project project = statusBar.getProject();
-    if (project == null || project.isDisposed()) return null;
-
-    FileEditorManager manager = FileEditorManager.getInstance(project);
-    Editor editor = manager.getSelectedTextEditor();
-    if (editor != null &&
-        ensureValidEditorFile(editor, null) &&
-        WindowManager.getInstance().getStatusBar(editor.getComponent(), project) == statusBar) {
-      return editor;
-    }
     return null;
   }