List<Editor> (@NotNull Document document) { Application application = ApplicationManager.getApplication(); // ignore caret placing when exiting if (application.isDisposed()) { return Collections.emptyList(); } List<Editor> activeEditors = new ArrayList<>(); Editor localEditor = getActiveLocalEditor(document); if (localEditor != null) { activeEditors.add(localEditor); } for (ClientEditorManager manager : application.getServices(ClientEditorManager.class, ClientKind.REMOTE)) { manager.editors().filter(e -> UIUtil.hasFocus(e.getContentComponent()) && e.getDocument() == document).forEach(activeEditors::add); } return activeEditors; }